{"thread":{"id":"9905","subject":"[PATCH 0/4] Make the documentation consistent for --track and --notrack","startedAt":"2007-09-18T01:04:53Z","lastAt":"2007-10-02T23:36:30Z","messageCount":13,"participants":["Federico Mena Quintero","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"53386","messageId":"1190077493.22387.54.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":null,"subject":"[PATCH 0/4] Make the documentation consistent for --track and --notrack","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-09-18T01:04:53Z","receivedAt":"2007-09-18T01:04:53Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"Hi,\n\nHere is the patchset I sent before, hopefully in a format more palatable\nto the list.\n\nThe first three patches try to improve the documentation for git-branch\nand git-checkout, adding docs for --track and --notrack to\ngit-branch.txt, and improving the ones that were in git-checkout.txt.\n\nThe last patch is for git-pull.sh; it gives the user a hint of what to\ndo when there's no branch configured to merge from.\n\n  Federico\n"},{"id":"53387","messageId":"1190077657.22387.58.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1190077493.22387.54.camel@cacharro.xalalinux.org","subject":"[PATCH 1/4] Mention that git-branch will not automatically check out the new branch","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-09-18T01:07:37Z","receivedAt":"2007-09-18T01:07:37Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"Signed-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-branch.txt |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 33bc31b..47e6f49 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -24,7 +24,9 @@ and option `-a` shows both.\n In its second form, a new branch named <branchname> will be created.\n It will start out with a head equal to the one given as <start-point>.\n If no <start-point> is given, the branch will be created with a head\n-equal to that of the currently checked out branch.\n+equal to that of the currently checked out branch.  Note that this\n+will create the new branch, but it will not switch the working tree to\n+it; use \"git checkout <newbranch>\" to switch to the new branch.\n \n When a local branch is started off a remote branch, git can setup the\n branch so that gitlink:git-pull[1] will appropriately merge from that\n-- \n1.5.2.4\n"},{"id":"53388","messageId":"1190077805.22387.61.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1190077493.22387.54.camel@cacharro.xalalinux.org","subject":"[PATCH 2/4] Copy the docs for --track and --notrack from git-checkout to git-branch","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-09-18T01:10:05Z","receivedAt":"2007-09-18T01:10:05Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"The docs for git-branch did not mention --track and --notrack in\nthe OPTIONS section.\n\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-branch.txt |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 47e6f49..8b98b52 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -93,6 +93,20 @@ OPTIONS\n --no-abbrev::\n \tDisplay the full sha1s in output listing rather than abbreviating them.\n \n+--track::\n+\tSet up configuration so that git-pull will automatically\n+\tretrieve data from the remote branch, otherwise you'll have to\n+\tuse \"git pull <url>\" explicitly.  Set the\n+\tbranch.autosetupmerge configuration variable to true if you\n+\twant git-checkout and git-branch to always behave as if\n+\t'--track' were given.\n+\n+--no-track::\n+\tWhen -b is given and a branch is created off a remote branch,\n+\tset up configuration so that git-pull will not retrieve data\n+\tfrom the remote branch, ignoring the branch.autosetupmerge\n+\tconfiguration variable.\n+\n <branchname>::\n \tThe name of the branch to create or delete.\n \tThe new branch name must pass all checks defined by\n-- \n1.5.2.4\n"},{"id":"53389","messageId":"1190077881.22387.63.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1190077493.22387.54.camel@cacharro.xalalinux.org","subject":"[PATCH 3/4] Mention the parameters that git-pull would need to be equivalent to a --track in the git-checkout docs","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-09-18T01:11:21Z","receivedAt":"2007-09-18T01:11:21Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"To be consistent with the git-branch docs.\n\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-checkout.txt |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 734928b..6f22626 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -50,7 +50,8 @@ OPTIONS\n --track::\n \tWhen -b is given and a branch is created off a remote branch,\n \tset up configuration so that git-pull will automatically\n-\tretrieve data from the remote branch.  Set the\n+\tretrieve data from the remote branch, otherwise you'll have to\n+\tuse \"git pull <url>\" explicitly.  Set the\n \tbranch.autosetupmerge configuration variable to true if you\n \twant git-checkout and git-branch to always behave as if\n \t'--track' were given.\n-- \n1.5.2.4\n"},{"id":"53391","messageId":"1190077948.22387.66.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1190077493.22387.54.camel@cacharro.xalalinux.org","subject":"[PATCH 4/4] Make git-pull give hints on what to do when there is no branch to merge from","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-09-18T01:12:28Z","receivedAt":"2007-09-18T01:12:28Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"Signed-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n git-pull.sh |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 5e96d1f..7beef4d 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -98,7 +98,11 @@ case \"$merge_head\" in\n \tcurr_branch=${curr_branch#refs/heads/}\n \n \techo >&2 \"Warning: No merge candidate found because value of config option\n-         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n+         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\n+         This branch is not set up to track any other branches.  Please name which\n+         branch you want to merge from on the command line, or if you almost always\n+         want to merge from the same branch, then set this up with\n+         \\\"git branch --track\\\".\"\n \techo >&2 \"No changes.\"\n \texit 0\n \t;;\n-- \n1.5.2.4\n"},{"id":"53515","messageId":"7v3axbvbto.fsf@gitster.siamese.dyndns.org","threadId":"9905","inReplyTo":"1190077881.22387.63.camel@cacharro.xalalinux.org","subject":"Re: [PATCH 3/4] Mention the parameters that git-pull would need to be equivalent to a --track in the git-checkout docs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-18T22:38:27Z","receivedAt":"2007-09-18T22:38:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Federico Mena Quintero <federico@novell.com> writes:\n\n> To be consistent with the git-branch docs.\n>\n> Signed-off-by: Federico Mena Quintero <federico@gnu.org>\n> ---\n>  Documentation/git-checkout.txt |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\n> index 734928b..6f22626 100644\n> --- a/Documentation/git-checkout.txt\n> +++ b/Documentation/git-checkout.txt\n> @@ -50,7 +50,8 @@ OPTIONS\n>  --track::\n>  \tWhen -b is given and a branch is created off a remote branch,\n>  \tset up configuration so that git-pull will automatically\n> -\tretrieve data from the remote branch.  Set the\n> +\tretrieve data from the remote branch, otherwise you'll have to\n> +\tuse \"git pull <url>\" explicitly.  Set the\n>  \tbranch.autosetupmerge configuration variable to true if you\n>  \twant git-checkout and git-branch to always behave as if\n>  \t'--track' were given.\n\nHmph.\n\nI'd rather make them consistent by dropping the not-so-correct\n\"otherwise\" phrase from all three copies.  It is not \"otherwise\nyou'll have to\", but \"instead you can\".\n"},{"id":"53525","messageId":"7vsl5btw80.fsf@gitster.siamese.dyndns.org","threadId":"9905","inReplyTo":"1190077948.22387.66.camel@cacharro.xalalinux.org","subject":"Re: [PATCH 4/4] Make git-pull give hints on what to do when there is no branch to merge from","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-18T23:00:47Z","receivedAt":"2007-09-18T23:00:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Federico Mena Quintero <federico@novell.com> writes:\n\n> Signed-off-by: Federico Mena Quintero <federico@gnu.org>\n> ---\n>  git-pull.sh |    6 +++++-\n>  1 files changed, 5 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-pull.sh b/git-pull.sh\n> index 5e96d1f..7beef4d 100755\n> --- a/git-pull.sh\n> +++ b/git-pull.sh\n> @@ -98,7 +98,11 @@ case \"$merge_head\" in\n>  \tcurr_branch=${curr_branch#refs/heads/}\n>  \n>  \techo >&2 \"Warning: No merge candidate found because value of config option\n> -         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n> +         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\n> +         This branch is not set up to track any other branches.  Please name which\n> +         branch you want to merge from on the command line, or if you almost always\n> +         want to merge from the same branch, then set this up with\n> +         \\\"git branch --track\\\".\"\n\nThis is a nice attempt, but can you use \"git branch --track\" to\nset this?  What does the command line look like?\n\nThis error can come when branch.<foo>.merge does not match what\nremote.<bar>.fetch says (where branch.<foo>.remote is <bar>),\nbut it is my understanding that the builtin-fetch work by Daniel\nand Shawn would fetch branch.<foo>.merge as well to reduce this\nerror.  Another possibility is when the user does not have any\nbranch.<foo>.merge.\n\nI am inclined to suggest rewording the message like this, and\nmake this condition an error (i.e. \"exit 1\"):\n\n    You asked me to pull without telling me which branch you\n    want to merge with, and 'branch.${curr_branch}.merge' in\n    your configuration file does not tell me either.  Please\n    name which branch you want to merge on the command line and\n    try again.\n\n    If you often merge with the same branch, you may want to\n    configure the following variables in your configuration\n    file:\n\n\tbranch.${curr_branch}.remote = <nickname>\n\tbranch.${curr_branch}.merge = <remote-ref>\n        remote.<nickname>.url = <url>\n        remote.<nickname>.fetch = <refspec>\n\n    See git-config(1) for details.\n"},{"id":"54621","messageId":"1191367817.3776.192.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"7v3axbvbto.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 0/4] Another round of the --track patches","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:30:17Z","receivedAt":"2007-10-02T23:30:17Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"On Tue, 2007-09-18 at 15:38 -0700, Junio C Hamano wrote:\n> Federico Mena Quintero <federico@novell.com> writes:\n> > -\tretrieve data from the remote branch.  Set the\n> > +\tretrieve data from the remote branch, otherwise you'll have to\n> > +\tuse \"git pull <url>\" explicitly.  Set the\n> >  \tbranch.autosetupmerge configuration variable to true if you\n> >  \twant git-checkout and git-branch to always behave as if\n> >  \t'--track' were given.\n> \n> Hmph.\n> \n> I'd rather make them consistent by dropping the not-so-correct\n> \"otherwise\" phrase from all three copies.  It is not \"otherwise\n> you'll have to\", but \"instead you can\".\n\nSure, I've added better wording now.\n\n> I am inclined to suggest rewording the message like this, and\n> make this condition an error (i.e. \"exit 1\"):\n[snip]\n\nI like that message much better, and it's nice that it gives you the\nsnippet to put in your config file.  This is in patch 4/4.\n\nThanks for the review; I hope this can make it in now ;)\n\n  Federico\n"},{"id":"54622","messageId":"1191367952.3776.196.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1191367817.3776.192.camel@cacharro.xalalinux.org","subject":"[PATCH 1/4] Say when --track is useful in the git-checkout docs.","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:32:32Z","receivedAt":"2007-10-02T23:32:32Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"The documentation used to say what the option does, but it\ndidn't mention a use case.\n\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-checkout.txt |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 734928b..dbd1a4a 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -50,7 +50,9 @@ OPTIONS\n --track::\n \tWhen -b is given and a branch is created off a remote branch,\n \tset up configuration so that git-pull will automatically\n-\tretrieve data from the remote branch.  Set the\n+\tretrieve data from the remote branch.  Use this if you always\n+\tpull from the same remote branch into the new branch, or if you\n+\tdon't want to use \"git pull <repository> <refspec>\" explicitly.  Set the\n \tbranch.autosetupmerge configuration variable to true if you\n \twant git-checkout and git-branch to always behave as if\n \t'--track' were given.\n-- \n1.5.2.4\n"},{"id":"54623","messageId":"1191368010.3776.198.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1191367817.3776.192.camel@cacharro.xalalinux.org","subject":"[PATCH 1/4] Add documentation for --track and --no-track to the git-branch docs.","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:33:30Z","receivedAt":"2007-10-02T23:33:30Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-branch.txt |   15 +++++++++++++++\n 1 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 33bc31b..e9c12f9 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -91,6 +91,21 @@ OPTIONS\n --no-abbrev::\n \tDisplay the full sha1s in output listing rather than abbreviating them.\n \n+--track::\n+\tSet up configuration so that git-pull will automatically\n+\tretrieve data from the remote branch.  Use this if you always\n+\tpull from the same remote branch into the new branch, or if you\n+\tdon't want to use \"git pull <repository> <refspec>\" explicitly.  Set the\n+\tbranch.autosetupmerge configuration variable to true if you\n+\twant git-checkout and git-branch to always behave as if\n+\t'--track' were given.\n+\n+--no-track::\n+\tWhen -b is given and a branch is created off a remote branch,\n+\tset up configuration so that git-pull will not retrieve data\n+\tfrom the remote branch, ignoring the branch.autosetupmerge\n+\tconfiguration variable.\n+\n <branchname>::\n \tThe name of the branch to create or delete.\n \tThe new branch name must pass all checks defined by\n-- \n1.5.2.4\n"},{"id":"54625","messageId":"1191368072.3776.201.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1191367817.3776.192.camel@cacharro.xalalinux.org","subject":"[PATCH 3/4] Note that git-branch will not automatically checkout the new branch","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:34:32Z","receivedAt":"2007-10-02T23:34:32Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n Documentation/git-branch.txt |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex e9c12f9..53c1158 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -26,6 +26,10 @@ It will start out with a head equal to the one given as <start-point>.\n If no <start-point> is given, the branch will be created with a head\n equal to that of the currently checked out branch.\n \n+Note that this will create the new branch, but it will not switch the\n+working tree to it; use \"git checkout <newbranch>\" to switch to the\n+new branch.\n+\n When a local branch is started off a remote branch, git can setup the\n branch so that gitlink:git-pull[1] will appropriately merge from that\n remote branch.  If this behavior is desired, it is possible to make it\n-- \n1.5.2.4\n"},{"id":"54626","messageId":"1191368120.3776.204.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1191368010.3776.198.camel@cacharro.xalalinux.org","subject":"Re: [PATCH 1/4] Add documentation for --track and --no-track to the git-branch docs.","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:35:20Z","receivedAt":"2007-10-02T23:35:20Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"Arrrr... this should be \"[PATCH 2/4]\", of course.  Sorry for the\nconfusion.\n\n  Federico\n"},{"id":"54627","messageId":"1191368190.3776.206.camel@cacharro.xalalinux.org","threadId":"9905","inReplyTo":"1191367817.3776.192.camel@cacharro.xalalinux.org","subject":"[PATCH 4/4] Make git-pull complain and give advice when there is nothing to pull from","fromName":"Federico Mena Quintero","fromEmail":"federico@novell.com","sentAt":"2007-10-02T23:36:30Z","receivedAt":"2007-10-02T23:36:30Z","isPatch":true,"sender":{"key":"federico@novell.com","avatar":null},"body":"\nSigned-off-by: Federico Mena Quintero <federico@gnu.org>\n---\n git-pull.sh |   22 ++++++++++++++++++----\n 1 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex c3f05f5..74bfc16 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -97,10 +97,24 @@ case \"$merge_head\" in\n \tesac\n \tcurr_branch=${curr_branch#refs/heads/}\n \n-\techo >&2 \"Warning: No merge candidate found because value of config option\n-         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n-\techo >&2 \"No changes.\"\n-\texit 0\n+\techo >&2 \"You asked me to pull without telling me which branch you\"\n+\techo >&2 \"want to merge with, and 'branch.${curr_branch}.merge' in\"\n+\techo >&2 \"your configuration file does not tell me either.  Please\"\n+\techo >&2 \"name which branch you want to merge on the command line and\"\n+\techo >&2 \"try again (e.g. 'git pull <repository> <refspec>').\"\n+\techo >&2 \"See git-pull(1) for details on the refspec.\"\n+\techo >&2\n+\techo >&2 \"If you often merge with the same branch, you may want to\"\n+\techo >&2 \"configure the following variables in your configuration\"\n+\techo >&2 \"file:\"\n+\techo >&2\n+\techo >&2 \"    branch.${curr_branch}.remote = <nickname>\"\n+\techo >&2 \"    branch.${curr_branch}.merge = <remote-ref>\"\n+\techo >&2 \"    remote.<nickname>.url = <url>\"\n+\techo >&2 \"    remote.<nickname>.fetch = <refspec>\"\n+\techo >&2\n+\techo >&2 \"See git-config(1) for details.\"\n+\texit 1\n \t;;\n ?*' '?*)\n \tif test -z \"$orig_head\"\n-- \n1.5.2.4\n"}]}