Skip to content

Commit 091a7f6

Browse files
committed
docs: Better document operations in "Basic" mode.
1 parent 093ec2e commit 091a7f6

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ ClassMethod Commit(InternalName As %String, Message As %String = "example commit
414414
quit $$$OK
415415
}
416416

417+
/// <p>This function performs <code>git checkout -b [newBranchName]</code> from the current commit.</p>
418+
/// <p>If the user is in "Basic Mode" AND there is a Default Merge Branch defined,
419+
/// then this method first checks out and pulls that default merge branch before creating the new branch. This is
420+
/// equivalent to <code>git checkout [defaultMergeBranch] && git pull</code>.</p>
417421
ClassMethod NewBranch(newBranchName As %String) As %Status
418422
{
419423
set settings = ##class(SourceControl.Git.Settings).%New()
@@ -511,8 +515,12 @@ ClassMethod StageAddedFiles()
511515
}
512516
}
513517

514-
/// Merges the files from the configured branch as part of the Sync operation
515-
/// Returns true if this resulted in durable changes to the local git repo
518+
/// <p>If there is a configured "Default Merge Branch", then
519+
/// <ol>
520+
/// <li>fetch the current version of the default merge branch.</li>
521+
/// <li>attempt to rebase the current branch onto the default merge branch.</li>
522+
/// </ol>
523+
/// Returns true if this resulted in durable changes to the local git repo, false otherwise.</p>
516524
ClassMethod MergeDefaultRemoteBranch(Output alert As %String = "") As %Boolean
517525
{
518526
set rebased = 0

docs/menu-items.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,22 @@ This also has the effect of refreshing the list of all remote branches and pruni
3737
Much like the [git pull](https://git-scm.com/docs/git-pull) command, this menu option pulls the most recent version of the current branch from a remote source, merging the changes into the local copy.
3838

3939
## Sync
40-
This option will synchronize a local repo with the remote repo. The sync operation is only enabled in basic mode. It encapsulates the pattern of fetching, pulling, committing and then pushing into one menu action. If there is no defined remote repository, it will simply commit any uncommitted files.
40+
This option will synchronize the current branch checked out a local repo with the same branch in a remote repo. It encapsulates the pattern of fetching, pulling, committing, and pushing into one menu action.
41+
- If you are on the Default Merge Branch, then Sync only pulls the latest commits from the remote. Committing is disallowed on the Default Merge Branch.
42+
- If there is no defined remote repository, it will simply commit any uncommitted files.
43+
- If there is a Default Merge Branch defined, then sync attempts to perform a rebase onto the latest Default Merge Branch from the remote.
44+
- If the rebase were to result in merge conflicts, then this action is aborted so the system is not left in an inconsistent state.
45+
46+
47+
The sync operation is only enabled in basic mode.
4148

4249
## Create new branch
4350
This menu option creates a new branch in the repository for changes to be committed to. It also changes the current branch to be the created branch. This mimics the behavior of the [git checkout -b](https://git-scm.com/docs/git-checkout) command.
4451

52+
In basic mode, this option first checks out the Default Merge Branch (if defined) and pulls that branch from the remote before creating the new branch.
53+
4554
## Check out an existing branch
46-
This option refreshes the local list of branches available in the upstream repository, and then changes the currently checkedout branch to the provided branch. This mimics the behavior of the [git fetch --prune](https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---prune) and [git checkout](https://git-scm.com/docs/git-checkout) commands.
55+
This option refreshes the local list of branches available in the upstream repository, and then changes the currently checked out branch to the provided branch. This mimics the behavior of the [git fetch --prune](https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---prune) and [git checkout](https://git-scm.com/docs/git-checkout) commands.
4756

4857
If the desired branch does not exist in your local or in the remote, then you will receive the "Selected branch does not exist" error message.
4958

0 commit comments

Comments
 (0)