{"thread":{"id":"20102","subject":"Make 'git show' more useful","startedAt":"2009-07-13T21:41:12Z","lastAt":"2009-07-17T14:53:56Z","messageCount":17,"participants":["Linus Torvalds","Junio C Hamano","Johannes Schindelin","Paolo Bonzini","Michael J Gruber","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"117918","messageId":"alpine.LFD.2.01.0907131425490.13838@localhost.localdomain","threadId":"20102","inReplyTo":null,"subject":"Make 'git show' more useful","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2009-07-13T21:41:12Z","receivedAt":"2009-07-13T21:41:12Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nFor some reason, I ended up doing\n\n\tgit show HEAD~5..\n\nas an odd way of asking for a log. I realize I should just have used \"git \nlog\", but at the same time it does make perfect conceptual sense. After \nall, you _could_ have done\n\n\tgit show HEAD HEAD~1 HEAD~2 HEAD~3 HEAD~4\n\nand saying \"git show HEAD~5..\" is pretty natural. It's not like \"git show\" \nonly ever showed a single commit (or other object) before either! So \nconceptually, giving a commit range is a very sensible operation, even \nthough you'd traditionally have used \"git log\" for that.\n\nHowever, doing that currently results in an error\n\n\tfatal: object ranges do not make sense when not walking revisions\n\nwhich admittedly _also_ makes perfect sense - from an internal git \nimplementation standpoint in 'revision.c'.\n\nHowever, I think that asking to show a range makes sense to a user, while \nsaying \"object ranges no not make sense when not walking revisions\" only \nmakes sense to a git developer.\n\nSo on the whole, of the two different \"makes perfect sense\" behaviors, I \nthink I originally picked the wrong one. And quite frankly, I don't really \nsee anybody actually _depending_ on that error case. So why not change it?\n\nSo rather than error out, just turn that non-walking error case into a \n\"silently turn on walking\" instead.\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n---\n\nThis is a total throw-away patch. I'm not going to re-send. Take it or \nnot, I don't care, I spent more time writing this discussion than I did on \nthe patch. I just happened to notice this behavior, and decided I probably \nwould prefer this behavior. But it doesn't really matter in any kind of \nbig picture.\n\nAnd, admittedly, you can _already_ do this by just adding \"--do-walk\" \nwhenever you specify a range. And equally admittedly, you can already \nconfuse git by adding the \"--no-walk\" _after_ specifying the range, ie you \ncan do this:\n\n\tgit log HEAD~5.. --no-walk\n\nand it will actually turn into a really odd way of saying \"git show HEAD\" \n(notice: _not_ \"HEAD~5\". HEAD). And even with this change you can do the \nreverse:\n\n\tgit show HEAD~5.. --no-walk\n\nit it will first implicitly turn off walking (\"git show\"), then it will \nimplicitly turn it on again (the commit range triggers the code in this \npatch), and then _after_ it has seen the commit range it will explicitly \nturn off walking again.\n\nIn other words, regardless of this patch you can do crazy things. I really \ndon't think anybody cares. This patch is not meant to disable crazy \nthings, it's meant to enable a reasonably sane user behavior.\n\n revision.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/revision.c b/revision.c\nindex a31434b..9f5dac5 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -133,7 +133,7 @@ void mark_parents_uninteresting(struct commit *commit)\n static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)\n {\n \tif (revs->no_walk && (obj->flags & UNINTERESTING))\n-\t\tdie(\"object ranges do not make sense when not walking revisions\");\n+\t\trevs->no_walk = 0;\n \tif (revs->reflog_info && obj->type == OBJ_COMMIT &&\n \t\t\tadd_reflog_for_walk(revs->reflog_info,\n \t\t\t\t(struct commit *)obj, name))\n"},{"id":"117920","messageId":"7vtz1gi67v.fsf@alter.siamese.dyndns.org","threadId":"20102","inReplyTo":"alpine.LFD.2.01.0907131425490.13838@localhost.localdomain","subject":"Re: Make 'git show' more useful","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-13T22:11:16Z","receivedAt":"2009-07-13T22:11:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> For some reason, I ended up doing\n>\n> \tgit show HEAD~5..\n>\n> as an odd way of asking for a log.\n\nHeh, I like that already.  Thanks ;-)\n"},{"id":"117926","messageId":"alpine.DEB.1.00.0907140140470.3155@pacific.mpi-cbg.de","threadId":"20102","inReplyTo":"alpine.LFD.2.01.0907131425490.13838@localhost.localdomain","subject":"Re: Make 'git show' more useful","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-13T23:42:22Z","receivedAt":"2009-07-13T23:42:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 13 Jul 2009, Linus Torvalds wrote:\n\n> For some reason, I ended up doing\n> \n> \tgit show HEAD~5..\n> \n> as an odd way of asking for a log. I realize I should just have used \"git \n> log\", but at the same time it does make perfect conceptual sense.\n\nFor some reason, I wrote exactly this patch some time ago, but I forgot \nwhy I did not send it.  Probably because I did not want to appear as a \ntotal moron in public.  Which apparently I end up doing anyway.\n\nSo count me in on the supporters' side of this patch,\nDscho\n"},{"id":"117927","messageId":"1247528614-24590-1-git-send-email-bonzini@gnu.org","threadId":"20102","inReplyTo":"7vtz1gi67v.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Re: Make 'git show' more useful","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-07-13T23:43:34Z","receivedAt":"2009-07-13T23:43:34Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"> And, admittedly, you can _already_ do this by just adding \"--do-walk\"\n> whenever you specify a range. And equally admittedly, you can already\n> confuse git by adding the \"--no-walk\" _after_ specifying the range,\n> ie you can do this:\n>\n> \tgit log HEAD~5.. --no-walk\n\nEven without the change you could do\n\n\tgit show --do-walk HEAD~5.. --no-walk\n\nBut then why do we want --do-walk and --no-walk?  You can always use \"git\nrev-parse\" instead of \"git rev-list --no-walk\" (just check that the output \nis a single SHA1 id), and I don't think it is so important to be able\nto say \"git log --no-walk\" instead of \"git log -1\".\n\nThey are not tested either.  Just gitk cares about --no-walk... to prevent\nthe user from giving it.\n\nSo, what about squashing this with Linus's patch?  (This is meant to be\nsquashed, which is why this text is not in a cover letter).  Still:\n\nSigned-off-by: Paolo Bonzini <bonzini@gnu.org>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\n---\n Documentation/git-rev-list.txt     |    1 -\n Documentation/rev-list-options.txt |    8 --------\n revision.c                         |   13 ++-----------\n gitk-git/gitk                      |    1 -+\n 3 files changed, 3 insertions(+), 21 deletions(-)\n\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex 1c9cc28..b02cf54 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -44,7 +44,6 @@ SYNOPSIS\n \t     [ \\--merge ]\n \t     [ \\--reverse ]\n \t     [ \\--walk-reflogs ]\n-\t     [ \\--no-walk ] [ \\--do-walk ]\n \t     <commit>... [ \\-- <paths>... ]\n \n DESCRIPTION\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 11eec94..d137e32 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -624,11 +624,3 @@ These options are mostly targeted for packing of git repositories.\n \n \tOnly useful with '--objects'; print the object IDs that are not\n \tin packs.\n-\n---no-walk::\n-\n-\tOnly show the given revs, but do not traverse their ancestors.\n-\n---do-walk::\n-\n-\tOverrides a previous --no-walk.\ndiff --git a/revision.c b/revision.c\nindex a31434b..8b1a385 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -993,8 +993,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t/* pseudo revision arguments */\n \tif (!strcmp(arg, \"--all\") || !strcmp(arg, \"--branches\") ||\n \t    !strcmp(arg, \"--tags\") || !strcmp(arg, \"--remotes\") ||\n-\t    !strcmp(arg, \"--reflog\") || !strcmp(arg, \"--not\") ||\n-\t    !strcmp(arg, \"--no-walk\") || !strcmp(arg, \"--do-walk\"))\n+\t    !strcmp(arg, \"--reflog\") || !strcmp(arg, \"--not\"))\n \t{\n \t\tunkv[(*unkc)++] = arg;\n \t\treturn 1;\n@@ -1273,14 +1272,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\t\t\tflags ^= UNINTERESTING;\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (!strcmp(arg, \"--no-walk\")) {\n-\t\t\t\trevs->no_walk = 1;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (!strcmp(arg, \"--do-walk\")) {\n-\t\t\t\trevs->no_walk = 0;\n-\t\t\t\tcontinue;\n-\t\t\t}\n \n \t\t\topts = handle_revision_opt(revs, argc - i, argv + i, &left, argv);\n \t\t\tif (opts > 0) {\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 4604c83..984d30a 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -169,7 +169,7 @@ proc parseviewargs {n arglist} {\n \t    \"--name-only\" - \"--name-status\" - \"--color\" - \"--color-words\" -\n \t    \"--log-size\" - \"--pretty=*\" - \"--decorate\" - \"--abbrev-commit\" -\n \t    \"--cc\" - \"-z\" - \"--header\" - \"--parents\" - \"--boundary\" -\n-\t    \"--no-color\" - \"-g\" - \"--walk-reflogs\" - \"--no-walk\" -\n+\t    \"--no-color\" - \"-g\" - \"--walk-reflogs\" -\n \t    \"--timestamp\" - \"relative-date\" - \"--date=*\" - \"--stdin\" -\n \t    \"--objects\" - \"--objects-edge\" - \"--reverse\" {\n \t\t# These cause our parsing of git log's output to fail, or else\n-- \n1.6.2.5\n"},{"id":"117928","messageId":"alpine.LFD.2.01.0907131652120.13838@localhost.localdomain","threadId":"20102","inReplyTo":"1247528614-24590-1-git-send-email-bonzini@gnu.org","subject":"Re: [PATCH] Re: Make 'git show' more useful","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2009-07-14T00:00:42Z","receivedAt":"2009-07-14T00:00:42Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 14 Jul 2009, Paolo Bonzini wrote:\n> \n> So, what about squashing this with Linus's patch?  (This is meant to be\n> squashed, which is why this text is not in a cover letter).\n\nI wouldn't squash it.\n\nThat said, in the original commit that introduced \"no_walk\" (ba1d4505), I \nsaid\n\n    I was going to add \"--no-walk\" as a real argument flag to git-rev-list\n    too, but I'm not sure anybody actually needs it. Although it might be\n    useful for porcelain, so I left the door open.\n\nand I never actually did it. That was Apr 15, 2006.\n\nThe actual \"--no-walk\" flag was then added over a year later by Dsco, in \ncommit 8e64006eee (\"Teach revision machinery about --no-walk\").\n\nDoing a \"git log -p -S--no-walk\", I have to admit that I don't find a \nsingle actual _use_ of --no-walk. And it obviously wasn't even exported \nuntil a year after it was internally implemented.\n\nSo I have to agree with the fact that \"--no-walk\" and \"--do-walk\" seem to \nbe pretty worthless as command line switches.  Removing them might be a \ngood thing.\n\nHowever, doing some googling, I do actually find examples of it on the \nweb. And some of them even appear valid:\n\n\tsecond_parent=$(git rev-list --no-walk --parents $newrev | sed 's/ /\\n/g' | grep -v $newrev | tail --lines=1)\n\nbecause you can't use \"git rev-parse\" with --parents (of course, I'm not \nat all clear on why it doesn't do\n\n\tsecond_parent=$(git rev-parse \"$newrev\"^2)\n\nbut that's really immaterial - the point is that \"git rev-parse\" is _not_ \na replacement for \"git rev-list --no-walk\").\n\nSo I dunno. I think we might as well leave --no-walk and --do-walk around, \neven though they are of dubious value. They do mirror the internal \nrevision walking logic very directly. \n\n\t\t\tLinus\n"},{"id":"117929","messageId":"alpine.DEB.1.00.0907140324140.3155@pacific.mpi-cbg.de","threadId":"20102","inReplyTo":"alpine.LFD.2.01.0907131652120.13838@localhost.localdomain","subject":"Re: [PATCH] Re: Make 'git show' more useful","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-14T01:25:55Z","receivedAt":"2009-07-14T01:25:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 13 Jul 2009, Linus Torvalds wrote:\n\n> The actual \"--no-walk\" flag was then added over a year later by Dsco, in \n> commit 8e64006eee (\"Teach revision machinery about --no-walk\").\n> \n> Doing a \"git log -p -S--no-walk\", I have to admit that I don't find a \n> single actual _use_ of --no-walk.\n\nActually, I remember very precisely why I introduced it.  The difference \nbetween \"git log --no-walk a b c\" and \"git show a b c\" is that \"git log\" \nsorts the commits by commit time, which is pretty important in my case.\n\nSo I'd appreciate not doing away with that option.\n\nThanks,\nDscho \"whose name has an h in it\"\n"},{"id":"117930","messageId":"alpine.LFD.2.01.0907131846460.13838@localhost.localdomain","threadId":"20102","inReplyTo":"alpine.DEB.1.00.0907140324140.3155@pacific.mpi-cbg.de","subject":"Re: [PATCH] Re: Make 'git show' more useful","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2009-07-14T01:47:53Z","receivedAt":"2009-07-14T01:47:53Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 14 Jul 2009, Johannes Schindelin wrote:\n>\n> Dscho \"whose name has an h in it\"\n\nPicky, picky.\n\nAt least your name isn't Russell, in which case you'd be losing that final \n'l' _all_ the time due to the world-wide shortage of said letters. The 'h' \ngoes missing only during temporary outages.\n\n\t\tLinus\n"},{"id":"117933","messageId":"4A5C24BE.4090804@gnu.org","threadId":"20102","inReplyTo":"alpine.DEB.1.00.0907140324140.3155@pacific.mpi-cbg.de","subject":"Re: [PATCH] Re: Make 'git show' more useful","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-07-14T06:25:02Z","receivedAt":"2009-07-14T06:25:02Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"\n>> The actual \"--no-walk\" flag was then added over a year later by Dsco, in\n>> commit 8e64006eee (\"Teach revision machinery about --no-walk\").\n>>\n>> Doing a \"git log -p -S--no-walk\", I have to admit that I don't find a\n>> single actual _use_ of --no-walk.\n>\n> Actually, I remember very precisely why I introduced it.  The difference\n> between \"git log --no-walk a b c\" and \"git show a b c\" is that \"git log\"\n> sorts the commits by commit time, which is pretty important in my case.\n\nVery nice.  Can you add a test for that?\n\n(OTOH do-walk seems to be superseded by Linus's patch).\n\nPaolo\n"},{"id":"117949","messageId":"alpine.DEB.1.00.0907141243410.3155@pacific.mpi-cbg.de","threadId":"20102","inReplyTo":"4A5C24BE.4090804@gnu.org","subject":"Re: [PATCH] Re: Make 'git show' more useful","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-14T10:44:05Z","receivedAt":"2009-07-14T10:44:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 14 Jul 2009, Paolo Bonzini wrote:\n\n> > > The actual \"--no-walk\" flag was then added over a year later by \n> > > Dsco, in commit 8e64006eee (\"Teach revision machinery about \n> > > --no-walk\").\n> > >\n> > > Doing a \"git log -p -S--no-walk\", I have to admit that I don't find \n> > > a single actual _use_ of --no-walk.\n> >\n> > Actually, I remember very precisely why I introduced it.  The \n> > difference between \"git log --no-walk a b c\" and \"git show a b c\" is \n> > that \"git log\" sorts the commits by commit time, which is pretty \n> > important in my case.\n> \n> Very nice.  Can you add a test for that?\n\nUnfortunately, no; I am very short on time.\n\nCiao,\nDscho\n"},{"id":"117951","messageId":"1247573287-9526-1-git-send-email-git@drmicha.warpmail.net","threadId":"20102","inReplyTo":"alpine.DEB.1.00.0907141243410.3155@pacific.mpi-cbg.de","subject":"[PATCH] t4202-log.sh: Test git log --no-walk sort order","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-14T12:08:07Z","receivedAt":"2009-07-14T12:08:07Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"'git log --no-walk' sorts commits by commit time whereas 'git show' does\nnot. Document this by two tests so that we never forget why ba1d450\n(Tentative built-in \"git show\", 2006-04-15) introduced it and\n8e64006 (Teach revision machinery about --no-walk, 2007-07-24) exposed\nit as an option argument.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nNot much to add here, besides the fact that the actual test target\nshould justify testing log as well as show here.\n\nBased off master.\n\n t/t4202-log.sh |   23 +++++++++++++++++++++++\n 1 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex aad3894..10ad5d2 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -149,6 +149,29 @@ test_expect_success 'git log --follow' '\n \n '\n \n+cat > expect << EOF\n+804a787 sixth\n+394ef78 fifth\n+5d31159 fourth\n+EOF\n+test_expect_success 'git log --no-walk <commits> sorts by commit time' '\n+\tgit log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat > expect << EOF\n+5d31159 fourth\n+ein\n+804a787 sixth\n+a/two\n+394ef78 fifth\n+a/two\n+EOF\n+test_expect_success 'git show <commits> does not sort by commit time' '\n+\tgit show --oneline --name-only 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'setup case sensitivity tests' '\n \techo case >one &&\n \ttest_tick &&\n-- \n1.6.3.3.483.g4f5e\n"},{"id":"117953","messageId":"4A5C785C.6060706@viscovery.net","threadId":"20102","inReplyTo":"1247573287-9526-1-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCH] t4202-log.sh: Test git log --no-walk sort order","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-07-14T12:21:48Z","receivedAt":"2009-07-14T12:21:48Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Michael J Gruber schrieb:\n> +test_expect_success 'git log --no-walk <commits> sorts by commit time' '\n...\n> +test_expect_success 'git show <commits> does not sort by commit time' '\n\nThanks, but sorry that I'm nit-picking here: You say what git show does\nnot do, but shouldn't you say what git show should do?\n\n\t'git show shows commits in command line order'\n\n-- Hannes\n"},{"id":"117955","messageId":"4A5C7C3A.9080506@drmicha.warpmail.net","threadId":"20102","inReplyTo":"4A5C785C.6060706@viscovery.net","subject":"Re: [PATCH] t4202-log.sh: Test git log --no-walk sort order","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-14T12:38:18Z","receivedAt":"2009-07-14T12:38:18Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Johannes Sixt venit, vidit, dixit 14.07.2009 14:21:\n> Michael J Gruber schrieb:\n>> +test_expect_success 'git log --no-walk <commits> sorts by commit time' '\n> ...\n>> +test_expect_success 'git show <commits> does not sort by commit time' '\n> \n> Thanks, but sorry that I'm nit-picking here:\n\nThis not being my first patch, I don't expect any patch to go through\nwithout nit-picking here - which, in most cases, is really a good thing ;)\n\n> You say what git show does\n> not do, but shouldn't you say what git show should do?\n> \n> \t'git show shows commits in command line order'\n\nWell, I assumed \"does not sort\" == \"leaves as is\". But, even if it is,\nstill \"does not sort by commit time\" != \"leaves as is\". v2 upcoming...\n\nMichael\n"},{"id":"117956","messageId":"1247575519-9629-1-git-send-email-git@drmicha.warpmail.net","threadId":"20102","inReplyTo":"4A5C785C.6060706@viscovery.net","subject":"[PATCHv2] t4202-log.sh: Test git log --no-walk sort order","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-14T12:45:19Z","receivedAt":"2009-07-14T12:45:19Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"'git log --no-walk' sorts commits by commit time whereas 'git show' does\nnot (it leaves them as given on the command line). Document this by two\ntests so that we never forget why ba1d450 (Tentative built-in \"git\nshow\", 2006-04-15) introduced it and 8e64006 (Teach revision machinery\nabout --no-walk, 2007-07-24) exposed it as an option argument.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nv2: Make it clearer (in the commmit message and the test description) that git\nshow leaves the commits as specified.\n\nNit-picked-by: Johannes Sixt <j.sixt@viscovery.net>\n...but he was right!\n\n t/t4202-log.sh |   23 +++++++++++++++++++++++\n 1 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex aad3894..72ba42c 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -149,6 +149,29 @@ test_expect_success 'git log --follow' '\n \n '\n \n+cat > expect << EOF\n+804a787 sixth\n+394ef78 fifth\n+5d31159 fourth\n+EOF\n+test_expect_success 'git log --no-walk <commits> sorts by commit time' '\n+\tgit log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat > expect << EOF\n+5d31159 fourth\n+ein\n+804a787 sixth\n+a/two\n+394ef78 fifth\n+a/two\n+EOF\n+test_expect_success 'git show <commits> leaves list of commits as given' '\n+\tgit show --oneline --name-only 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'setup case sensitivity tests' '\n \techo case >one &&\n \ttest_tick &&\n-- \n1.6.3.3.483.g4f5e\n"},{"id":"117961","messageId":"alpine.DEB.1.00.0907141612350.4553@intel-tinevez-2-302","threadId":"20102","inReplyTo":"1247575519-9629-1-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCHv2] t4202-log.sh: Test git log --no-walk sort order","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-14T14:13:57Z","receivedAt":"2009-07-14T14:13:57Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 14 Jul 2009, Michael J Gruber wrote:\n\n> 'git log --no-walk' sorts commits by commit time whereas 'git show' does\n> not (it leaves them as given on the command line). Document this by two\n> tests so that we never forget why ba1d450 (Tentative built-in \"git\n> show\", 2006-04-15) introduced it and 8e64006 (Teach revision machinery\n> about --no-walk, 2007-07-24) exposed it as an option argument.\n\nThanks.\n\n> +cat > expect << EOF\n> +5d31159 fourth\n> +ein\n> +804a787 sixth\n> +a/two\n> +394ef78 fifth\n> +a/two\n> +EOF\n> +test_expect_success 'git show <commits> leaves list of commits as given' '\n> +\tgit show --oneline --name-only 5d31159 804a787 394ef78 > actual &&\n> +\ttest_cmp expect actual\n> +'\n\nJust to hazard a guess: you probably used --name-only to avoid having the \nwhole diff in the output, right?  In that case, you might want to use -s \nin the future (I do not think this needs fixing in this patch).\n\nCiao,\nDscho\n"},{"id":"117963","messageId":"4A5C9624.1020404@drmicha.warpmail.net","threadId":"20102","inReplyTo":"alpine.DEB.1.00.0907141612350.4553@intel-tinevez-2-302","subject":"Re: [PATCHv2] t4202-log.sh: Test git log --no-walk sort order","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-14T14:28:52Z","receivedAt":"2009-07-14T14:28:52Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Johannes Schindelin venit, vidit, dixit 14.07.2009 16:13:\n> Hi,\n> \n> On Tue, 14 Jul 2009, Michael J Gruber wrote:\n> \n>> 'git log --no-walk' sorts commits by commit time whereas 'git show' does\n>> not (it leaves them as given on the command line). Document this by two\n>> tests so that we never forget why ba1d450 (Tentative built-in \"git\n>> show\", 2006-04-15) introduced it and 8e64006 (Teach revision machinery\n>> about --no-walk, 2007-07-24) exposed it as an option argument.\n> \n> Thanks.\n> \n>> +cat > expect << EOF\n>> +5d31159 fourth\n>> +ein\n>> +804a787 sixth\n>> +a/two\n>> +394ef78 fifth\n>> +a/two\n>> +EOF\n>> +test_expect_success 'git show <commits> leaves list of commits as given' '\n>> +\tgit show --oneline --name-only 5d31159 804a787 394ef78 > actual &&\n>> +\ttest_cmp expect actual\n>> +'\n> \n> Just to hazard a guess: you probably used --name-only to avoid having the \n> whole diff in the output, right?  In that case, you might want to use -s \n> in the future (I do not think this needs fixing in this patch).\n\nYes, exactly. I was looking for \"--no-p\". And I was looking really hard!\nI didn't see this in git-log.1 nor git-show.1 nor git-diff.1. Now,\nlooking again, I find it in git-diff-tree.1. Grrmml. With hindsight,\nit's clear that all diff-tree options apply.\n\nIt seems that more of git-diff-tree.txt should show up in the man pages\nfor diff, log and show (i.e. be in diff-*.txt) or at least be\nreferenced. What do you think?\n\nMichael\n"},{"id":"118175","messageId":"1247840886-14795-1-git-send-email-git@drmicha.warpmail.net","threadId":"20102","inReplyTo":"alpine.DEB.1.00.0907141612350.4553@intel-tinevez-2-302","subject":"[PATCH] t4202-log.sh: Test git log --no-walk sort order","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-17T14:28:06Z","receivedAt":"2009-07-17T14:28:06Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"'git log --no-walk' sorts commits by commit time whereas 'git show' does\nnot (it leaves them as given on the command line). Document this by two\ntests so that we never forget why ba1d450 (Tentative built-in \"git\nshow\", 2006-04-15) introduced it and 8e64006 (Teach revision machinery\nabout --no-walk, 2007-07-24) exposed it as an option argument.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/t4202-log.sh |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\nv3: For completeness' sake, use git show -s.\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex aad3894..48e0088 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -149,6 +149,26 @@ test_expect_success 'git log --follow' '\n \n '\n \n+cat > expect << EOF\n+804a787 sixth\n+394ef78 fifth\n+5d31159 fourth\n+EOF\n+test_expect_success 'git log --no-walk <commits> sorts by commit time' '\n+\tgit log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat > expect << EOF\n+5d31159 fourth\n+804a787 sixth\n+394ef78 fifth\n+EOF\n+test_expect_success 'git show <commits> leaves list of commits as given' '\n+\tgit show --oneline -s 5d31159 804a787 394ef78 > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'setup case sensitivity tests' '\n \techo case >one &&\n \ttest_tick &&\n-- \n1.6.3.3.483.g4f5e\n"},{"id":"118176","messageId":"alpine.DEB.1.00.0907171653300.4495@intel-tinevez-2-302","threadId":"20102","inReplyTo":"1247840886-14795-1-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCH] t4202-log.sh: Test git log --no-walk sort order","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-17T14:53:56Z","receivedAt":"2009-07-17T14:53:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 17 Jul 2009, Michael J Gruber wrote:\n\n> 'git log --no-walk' sorts commits by commit time whereas 'git show' does\n> not (it leaves them as given on the command line). Document this by two\n> tests so that we never forget why ba1d450 (Tentative built-in \"git\n> show\", 2006-04-15) introduced it and 8e64006 (Teach revision machinery\n> about --no-walk, 2007-07-24) exposed it as an option argument.\n> \n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n>  t/t4202-log.sh |   20 ++++++++++++++++++++\n>  1 files changed, 20 insertions(+), 0 deletions(-)\n> \n> v3: For completeness' sake, use git show -s.\n\nThanks!\n\nCiao,\nDscho\n"}]}