{"thread":{"id":"31695","subject":"git pull --no-ff documentation","startedAt":"2012-10-01T03:36:16Z","lastAt":"2012-10-01T20:24:40Z","messageCount":4,"participants":["乙酸鋰","Junio C Hamano","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200236","messageId":"CAHtLG6ROuyCg9WK79igJ=a=6pwT+7TjOJLCNwe454oW3hiJETg@mail.gmail.com","threadId":"31695","inReplyTo":null,"subject":"git pull --no-ff documentation","fromName":"乙酸鋰","fromEmail":"ch3cooli@gmail.com","sentAt":"2012-10-01T03:36:16Z","receivedAt":"2012-10-01T03:36:16Z","isPatch":false,"sender":{"key":"ch3cooli@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2804967?v=4"},"body":"Hi,\n\nThe order of options in git pull is not clear in the documentation\nIt only says\ngit pull [options] [<repository> [<refspec>...]]\nSo we have no idea which options should come first\n\nI tried\ngit pull -v --no-tags --progress --no-ff origin\nbut failed with unknown option 'no-ff'.\n\nBut if I ran\ngit pull -v --no-ff  --no-tags --progress origin\nit succeeded.\n\nRegards,\nch3cooli\n"},{"id":"200237","messageId":"7vsj9yerbh.fsf@alter.siamese.dyndns.org","threadId":"31695","inReplyTo":"CAHtLG6ROuyCg9WK79igJ=a=6pwT+7TjOJLCNwe454oW3hiJETg@mail.gmail.com","subject":"Re: git pull --no-ff documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-01T04:42:26Z","receivedAt":"2012-10-01T04:42:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"乙酸鋰 <ch3cooli@gmail.com> writes:\n\n> The order of options in git pull is not clear in the documentation\n> It only says\n> git pull [options] [<repository> [<refspec>...]]\n> So we have no idea which options should come first\n>\n> I tried\n> git pull -v --no-tags --progress --no-ff origin\n> but failed with unknown option 'no-ff'.\n>\n> But if I ran\n> git pull -v --no-ff  --no-tags --progress origin\n> it succeeded.\n\nThis actually is not about --no-ff but about --no-tags.  Any option\nthat \"pull\" itself does not care about stops the command line parser\nand the remainder of the command line is fed to underlying \"fetch\".\n\nPerhaps something like this?  But you should trace the codepath\ninvolved to see if this covers all uses of the --tags before using\nit for real projects, as I didn't.\n\n git-pull.sh | 21 ++++++++++-----------\n 1 file changed, 10 insertions(+), 11 deletions(-)\n\ndiff --git i/git-pull.sh w/git-pull.sh\nindex 2a10047..a53c1e5 100755\n--- i/git-pull.sh\n+++ w/git-pull.sh\n@@ -39,7 +39,7 @@ test -z \"$(git ls-files -u)\" || die_conflict\n test -f \"$GIT_DIR/MERGE_HEAD\" && die_merge\n \n strategy_args= diffstat= no_commit= squash= no_ff= ff_only=\n-log_arg= verbosity= progress= recurse_submodules=\n+log_arg= verbosity= progress= recurse_submodules= fetch_tags=\n merge_args= edit=\n curr_branch=$(git symbolic-ref -q HEAD)\n curr_branch_short=\"${curr_branch#refs/heads/}\"\n@@ -62,6 +62,8 @@ do\n \t\tprogress=--no-progress ;;\n \t-n|--no-stat|--no-summary)\n \t\tdiffstat=--no-stat ;;\n+\t-t|--t|--ta|--tag|--tags|--no-tags)\n+\t\tfetch_tags=\"$1\" ;;\n \t--stat|--summary)\n \t\tdiffstat=--stat ;;\n \t--log|--no-log)\n@@ -141,15 +143,12 @@ done\n \n error_on_no_merge_candidates () {\n \texec >&2\n-\tfor opt\n-\tdo\n-\t\tcase \"$opt\" in\n-\t\t-t|--t|--ta|--tag|--tags)\n-\t\t\techo \"Fetching tags only, you probably meant:\"\n-\t\t\techo \"  git fetch --tags\"\n-\t\t\texit 1\n-\t\tesac\n-\tdone\n+\tcase \"$fetch_tags\" in\n+\t-t|--t|--ta|--tag|--tags)\n+\t\techo \"Fetching tags only, you probably meant:\"\n+\t\techo \"  git fetch --tags\"\n+\t\texit 1\n+\tesac\n \n \tif test true = \"$rebase\"\n \tthen\n@@ -213,7 +212,7 @@ test true = \"$rebase\" && {\n \tdone\n }\n orig_head=$(git rev-parse -q --verify HEAD)\n-git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok \"$@\" || exit 1\n+git fetch $verbosity $progress $dry_run $recurse_submodules $fetch_tags --update-head-ok \"$@\" || exit 1\n test -z \"$dry_run\" || exit 0\n \n curr_head=$(git rev-parse -q --verify HEAD)\n"},{"id":"200288","messageId":"7EAC0E5241D6431599764E90FA821FCF@PhilipOakley","threadId":"31695","inReplyTo":"7vsj9yerbh.fsf@alter.siamese.dyndns.org","subject":"Re: git pull --no-ff documentation","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2012-10-01T19:54:59Z","receivedAt":"2012-10-01T19:54:59Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\n> 乙酸鋰 <ch3cooli@gmail.com> writes:\n>\n>> The order of options in git pull is not clear in the documentation\n>> It only says\n>> git pull [options] [<repository> [<refspec>...]]\n>> So we have no idea which options should come first\n>>\n>> I tried\n>> git pull -v --no-tags --progress --no-ff origin\n>> but failed with unknown option 'no-ff'.\n>>\n>> But if I ran\n>> git pull -v --no-ff  --no-tags --progress origin\n>> it succeeded.\n>\n> This actually is not about --no-ff but about --no-tags.  Any option\n> that \"pull\" itself does not care about stops the command line parser\n> and the remainder of the command line is fed to underlying \"fetch\".\n>\n\nShould this be said within the documentation's synopsis ?\n\ne.g.\ngit pull [pull_options] [merge_options] [fetch_options [<repository> \n[<refspec>…]]\n\n> Perhaps something like this?  But you should trace the codepath\n> involved to see if this covers all uses of the --tags before using\n> it for real projects, as I didn't.\n>\n> git-pull.sh | 21 ++++++++++-----------\n> 1 file changed, 10 insertions(+), 11 deletions(-)\n>\n> diff --git i/git-pull.sh w/git-pull.sh\n> index 2a10047..a53c1e5 100755\n> --- i/git-pull.sh\n> +++ w/git-pull.sh\n> @@ -39,7 +39,7 @@ test -z \"$(git ls-files -u)\" || die_conflict\n> test -f \"$GIT_DIR/MERGE_HEAD\" && die_merge\n>\n> strategy_args= diffstat= no_commit= squash= no_ff= ff_only=\n> -log_arg= verbosity= progress= recurse_submodules=\n> +log_arg= verbosity= progress= recurse_submodules= fetch_tags=\n> merge_args= edit=\n> curr_branch=$(git symbolic-ref -q HEAD)\n> curr_branch_short=\"${curr_branch#refs/heads/}\"\n> @@ -62,6 +62,8 @@ do\n>  progress=--no-progress ;;\n>  -n|--no-stat|--no-summary)\n>  diffstat=--no-stat ;;\n> + -t|--t|--ta|--tag|--tags|--no-tags)\n> + fetch_tags=\"$1\" ;;\n>  --stat|--summary)\n>  diffstat=--stat ;;\n>  --log|--no-log)\n> @@ -141,15 +143,12 @@ done\n>\n> error_on_no_merge_candidates () {\n>  exec >&2\n> - for opt\n> - do\n> - case \"$opt\" in\n> - -t|--t|--ta|--tag|--tags)\n> - echo \"Fetching tags only, you probably meant:\"\n> - echo \"  git fetch --tags\"\n> - exit 1\n> - esac\n> - done\n> + case \"$fetch_tags\" in\n> + -t|--t|--ta|--tag|--tags)\n> + echo \"Fetching tags only, you probably meant:\"\n> + echo \"  git fetch --tags\"\n> + exit 1\n> + esac\n>\n>  if test true = \"$rebase\"\n>  then\n> @@ -213,7 +212,7 @@ test true = \"$rebase\" && {\n>  done\n> }\n> orig_head=$(git rev-parse -q --verify HEAD)\n> -git fetch $verbosity $progress $dry_run \n> $recurse_submodules --update-head-ok \"$@\" || exit 1\n> +git fetch $verbosity $progress $dry_run $recurse_submodules \n> $fetch_tags --update-head-ok \"$@\" || exit 1\n> test -z \"$dry_run\" || exit 0\n>\n> curr_head=$(git rev-parse -q --verify HEAD)\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n>\n> -----\n> No virus found in this message.\n> Checked by AVG - www.avg.com\n> Version: 2012.0.2221 / Virus Database: 2441/5300 - Release Date: \n> 09/30/12\n> \n"},{"id":"200290","messageId":"7vmx06aqk7.fsf@alter.siamese.dyndns.org","threadId":"31695","inReplyTo":"7EAC0E5241D6431599764E90FA821FCF@PhilipOakley","subject":"Re: git pull --no-ff documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-01T20:24:40Z","receivedAt":"2012-10-01T20:24:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n>> This actually is not about --no-ff but about --no-tags.  Any option\n>> that \"pull\" itself does not care about stops the command line parser\n>> and the remainder of the command line is fed to underlying \"fetch\".\n>>\n>\n> Should this be said within the documentation's synopsis ?\n>\n> e.g.\n> git pull [pull_options] [merge_options] [fetch_options [<repository>\n> [<refspec>…]]\n\nWe certainly could do that, but I was hoping somebody would\nvolunteer to make it easier to the end users so that they do not\nhave to remember which one is which.\n\nThe \"perhaps something like this?\" patch was a hint to show the\nfirst step in that preferrable direction.\n"}]}