{"thread":{"id":"45071","subject":"[PATCH] rev-list-options.txt: update --all about detached HEAD","startedAt":"2017-02-07T13:39:07Z","lastAt":"2017-02-08T23:02:14Z","messageCount":4,"participants":["Nguyễn Thái Ngọc Duy","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"310983","messageId":"20170207133850.14056-1-pclouds@gmail.com","threadId":"45071","inReplyTo":null,"subject":"[PATCH] rev-list-options.txt: update --all about detached HEAD","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2017-02-07T13:38:49Z","receivedAt":"2017-02-07T13:39:07Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This is the document patch for f0298cf1c6 (revision walker: include a\ndetached HEAD in --all - 2009-01-16)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/rev-list-options.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 5da7cf5a8d..72212ac6ec 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -133,8 +133,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).\n \tfor all following revision specifiers, up to the next `--not`.\n \n --all::\n-\tPretend as if all the refs in `refs/` are listed on the\n-\tcommand line as '<commit>'.\n+\tPretend as if all the refs in `refs/` (and HEAD if detached)\n+\tare listed on the command line as '<commit>'.\n \n --branches[=<pattern>]::\n \tPretend as if all the refs in `refs/heads` are listed\n-- \n2.11.0.157.gd943d85\n\n"},{"id":"310999","messageId":"20170207194239.icyqawhja2losjul@sigill.intra.peff.net","threadId":"45071","inReplyTo":"20170207133850.14056-1-pclouds@gmail.com","subject":"Re: [PATCH] rev-list-options.txt: update --all about detached HEAD","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-02-07T19:42:39Z","receivedAt":"2017-02-07T19:49:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 07, 2017 at 08:38:49PM +0700, Nguyễn Thái Ngọc Duy wrote:\n\n> This is the document patch for f0298cf1c6 (revision walker: include a\n> detached HEAD in --all - 2009-01-16)\n> [...]\n>  --all::\n> -\tPretend as if all the refs in `refs/` are listed on the\n> -\tcommand line as '<commit>'.\n> +\tPretend as if all the refs in `refs/` (and HEAD if detached)\n> +\tare listed on the command line as '<commit>'.\n\nI think this is an improvement, but I'm not sure about the \"if detached\"\nbit. We always read HEAD, no matter what.\n\nIf you only care about reachability, then reading HEAD only has an\nimpact if it is detached, since otherwise we know that we will grab the\nref via refs/.\n\nI'm not sure if it would matter for some other cases, though. For\nexample, with \"--source\", do we report HEAD or the matching ref? It\nlooks like the latter (because we read the refs first).\n\nI suspect you could also construct a case with excludes like:\n\n  $ git checkout foo\n  $ git rev-list --exclude=refs/heads/foo --all\n\nwhere it is relevant that we read HEAD separately from refs/heads/foo.\n\nSo I think just \"and HEAD\" is better, like:\n\n  Pretend as if all the refs in `refs/`, along with `HEAD`, are\n  listed...\n\n-Peff\n"},{"id":"311036","messageId":"20170208060641.13793-1-pclouds@gmail.com","threadId":"45071","inReplyTo":"20170207133850.14056-1-pclouds@gmail.com","subject":"[PATCH v2] rev-list-options.txt: update --all about HEAD","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2017-02-08T06:06:41Z","receivedAt":"2017-02-08T06:06:59Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This is the document patch for f0298cf1c6 (revision walker: include a\ndetached HEAD in --all - 2009-01-16).\n\nEven though that commit is about detached HEAD, as Jeff pointed out,\nalways adding HEAD in that case may have subtle differences with\n--source or --exclude. So the document mentions nothing about the\ndetached-ness.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n v2 drops \"detached\".\n\n Documentation/rev-list-options.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 5da7cf5a8d..a02f7324c0 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -133,8 +133,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).\n \tfor all following revision specifiers, up to the next `--not`.\n \n --all::\n-\tPretend as if all the refs in `refs/` are listed on the\n-\tcommand line as '<commit>'.\n+\tPretend as if all the refs in `refs/`, along with `HEAD`, are\n+\tlisted on the command line as '<commit>'.\n \n --branches[=<pattern>]::\n \tPretend as if all the refs in `refs/heads` are listed\n-- \n2.11.0.157.gd943d85\n\n"},{"id":"311117","messageId":"20170208230145.eayyz7fdj2ha6guo@sigill.intra.peff.net","threadId":"45071","inReplyTo":"20170208060641.13793-1-pclouds@gmail.com","subject":"Re: [PATCH v2] rev-list-options.txt: update --all about HEAD","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-02-08T23:01:45Z","receivedAt":"2017-02-08T23:02:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 08, 2017 at 01:06:41PM +0700, Nguyễn Thái Ngọc Duy wrote:\n\n> This is the document patch for f0298cf1c6 (revision walker: include a\n> detached HEAD in --all - 2009-01-16).\n> \n> Even though that commit is about detached HEAD, as Jeff pointed out,\n> always adding HEAD in that case may have subtle differences with\n> --source or --exclude. So the document mentions nothing about the\n> detached-ness.\n> \n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  v2 drops \"detached\".\n\nThanks. Seems like an obvious improvement to me.\n\n-Peff\n"}]}