[PATCH 0/4] Make the documentation consistent for --track and --notrack

DORMANTno replies

5 messages, 1 author, 2016-06-15 · open the first message on its own page

[PATCH 0/4] Make the documentation consistent for --track and --notrack

From: Federico Mena Quintero <hidden>
Date: 2016-06-15 22:43:35

Hi,

Here is the patchset I sent before, hopefully in a format more palatable
to the list.

The first three patches try to improve the documentation for git-branch
and git-checkout, adding docs for --track and --notrack to
git-branch.txt, and improving the ones that were in git-checkout.txt.

The last patch is for git-pull.sh; it gives the user a hint of what to
do when there's no branch configured to merge from.

  Federico

[PATCH 1/4] Mention that git-branch will not automatically check out the new branch

From: Federico Mena Quintero <hidden>
Date: 2016-06-15 22:43:35

Signed-off-by: Federico Mena Quintero <redacted>
---
 Documentation/git-branch.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 33bc31b..47e6f49 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -24,7 +24,9 @@ and option `-a` shows both.
 In its second form, a new branch named <branchname> will be created.
 It will start out with a head equal to the one given as <start-point>.
 If no <start-point> is given, the branch will be created with a head
-equal to that of the currently checked out branch.
+equal to that of the currently checked out branch.  Note that this
+will create the new branch, but it will not switch the working tree to
+it; use "git checkout <newbranch>" to switch to the new branch.
 
 When a local branch is started off a remote branch, git can setup the
 branch so that gitlink:git-pull[1] will appropriately merge from that
-- 
1.5.2.4

[PATCH 2/4] Copy the docs for --track and --notrack from git-checkout to git-branch

From: Federico Mena Quintero <hidden>
Date: 2016-06-15 22:43:35

The docs for git-branch did not mention --track and --notrack in
the OPTIONS section.

Signed-off-by: Federico Mena Quintero <redacted>
---
 Documentation/git-branch.txt |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 47e6f49..8b98b52 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -93,6 +93,20 @@ OPTIONS
 --no-abbrev::
 	Display the full sha1s in output listing rather than abbreviating them.
 
+--track::
+	Set up configuration so that git-pull will automatically
+	retrieve data from the remote branch, otherwise you'll have to
+	use "git pull <url>" explicitly.  Set the
+	branch.autosetupmerge configuration variable to true if you
+	want git-checkout and git-branch to always behave as if
+	'--track' were given.
+
+--no-track::
+	When -b is given and a branch is created off a remote branch,
+	set up configuration so that git-pull will not retrieve data
+	from the remote branch, ignoring the branch.autosetupmerge
+	configuration variable.
+
 <branchname>::
 	The name of the branch to create or delete.
 	The new branch name must pass all checks defined by
-- 
1.5.2.4

[PATCH 3/4] Mention the parameters that git-pull would need to be equivalent to a --track in the git-checkout docs

From: Federico Mena Quintero <hidden>
Date: 2016-06-15 22:43:35

To be consistent with the git-branch docs.

Signed-off-by: Federico Mena Quintero <redacted>
---
 Documentation/git-checkout.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 734928b..6f22626 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -50,7 +50,8 @@ OPTIONS
 --track::
 	When -b is given and a branch is created off a remote branch,
 	set up configuration so that git-pull will automatically
-	retrieve data from the remote branch.  Set the
+	retrieve data from the remote branch, otherwise you'll have to
+	use "git pull <url>" explicitly.  Set the
 	branch.autosetupmerge configuration variable to true if you
 	want git-checkout and git-branch to always behave as if
 	'--track' were given.
-- 
1.5.2.4

[PATCH 4/4] Make git-pull give hints on what to do when there is no branch to merge from

From: Federico Mena Quintero <hidden>
Date: 2016-06-15 22:43:35

Signed-off-by: Federico Mena Quintero <redacted>
---
 git-pull.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 5e96d1f..7beef4d 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -98,7 +98,11 @@ case "$merge_head" in
 	curr_branch=${curr_branch#refs/heads/}
 
 	echo >&2 "Warning: No merge candidate found because value of config option
-         \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
+         \"branch.${curr_branch}.merge\" does not match any remote branch fetched.
+         This branch is not set up to track any other branches.  Please name which
+         branch you want to merge from on the command line, or if you almost always
+         want to merge from the same branch, then set this up with
+         \"git branch --track\"."
 	echo >&2 "No changes."
 	exit 0
 	;;
-- 
1.5.2.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help