{"thread":{"id":"14552","subject":"[PATCH] Add a notice to the doc of git-ls-tree.","startedAt":"2008-07-20T22:25:35Z","lastAt":"2008-07-28T09:23:46Z","messageCount":20,"participants":["Steve Frécinaux","Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84092","messageId":"1216592735-23789-1-git-send-email-code@istique.net","threadId":"14552","inReplyTo":null,"subject":"[PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Steve Frécinaux","fromEmail":"code@istique.net","sentAt":"2008-07-20T22:25:35Z","receivedAt":"2008-07-20T22:25:35Z","isPatch":true,"sender":{"key":"code@istique.net","avatar":null},"body":"The notice covers this behaviour:\nif you are in the git/ subdirectory of your repository, it will pick\nthe tree corresponding to that directory instead of the root one if you\nspecify the root tree object id.\n\nCompare the output of both of those commands:\n git-ls-tree cb44e6571708aa2792c73a289d87586fe3c0c362\n git-cat-file -p cb44e6571708aa2792c73a289d87586fe3c0c362\n---\n Documentation/git-ls-tree.txt |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt\nindex 1cdec22..7cba394 100644\n--- a/Documentation/git-ls-tree.txt\n+++ b/Documentation/git-ls-tree.txt\n@@ -21,6 +21,10 @@ though - 'paths' denote just a list of patterns to match, e.g. so specifying\n directory name (without '-r') will behave differently, and order of the\n arguments does not matter.\n \n+Note that if you give ls-tree the sha1 id of a parent of the tree\n+corresponding to the directory you're in, it will resolve that tree and list\n+its contents instead of listing the contents of the tree you gave.\n+\n OPTIONS\n -------\n <tree-ish>::\n-- \n1.5.6.2\n"},{"id":"84097","messageId":"20080720230846.GH32184@machine.or.cz","threadId":"14552","inReplyTo":"1216592735-23789-1-git-send-email-code@istique.net","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-20T23:08:46Z","receivedAt":"2008-07-20T23:08:46Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Mon, Jul 21, 2008 at 12:25:35AM +0200, Steve Frécinaux wrote:\n> The notice covers this behaviour:\n> if you are in the git/ subdirectory of your repository, it will pick\n> the tree corresponding to that directory instead of the root one if you\n> specify the root tree object id.\n> \n> Compare the output of both of those commands:\n>  git-ls-tree cb44e6571708aa2792c73a289d87586fe3c0c362\n>  git-cat-file -p cb44e6571708aa2792c73a289d87586fe3c0c362\n> ---\n>  Documentation/git-ls-tree.txt |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt\n> index 1cdec22..7cba394 100644\n> --- a/Documentation/git-ls-tree.txt\n> +++ b/Documentation/git-ls-tree.txt\n> @@ -21,6 +21,10 @@ though - 'paths' denote just a list of patterns to match, e.g. so specifying\n>  directory name (without '-r') will behave differently, and order of the\n>  arguments does not matter.\n>  \n> +Note that if you give ls-tree the sha1 id of a parent of the tree\n> +corresponding to the directory you're in, it will resolve that tree and list\n> +its contents instead of listing the contents of the tree you gave.\n> +\n>  OPTIONS\n>  -------\n>  <tree-ish>::\n\nIt's hard to make out what do you mean, the patch description is much\nclearer, paradoxically. Also, this in fact holds for the root tree\ninstead of the parent tree, and the behaviour changes from \"weird\" to\n\"simply broken\" when you try to list a tree object that is _not_ the\nroot project tree from within a subdirectory:\n\n\tgit$ git ls-tree HEAD Documentation\n\t040000 tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1    Documentation\n\tgit/Documentation$ git ls-tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1\n\tgit/Documentation$\n\nI think that ls-tree simply shouldn't auto-fill its pathspec based on\ncurrent prefix in case no pathspec was supplied. Patch to follow.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84101","messageId":"f35478f50807201622n282e7eefve94ae144bfb720a7@mail.gmail.com","threadId":"14552","inReplyTo":"20080720230846.GH32184@machine.or.cz","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Steve Frécinaux","fromEmail":"nudrema@gmail.com","sentAt":"2008-07-20T23:22:58Z","receivedAt":"2008-07-20T23:22:58Z","isPatch":true,"sender":{"key":"nudrema@gmail.com","avatar":null},"body":"> It's hard to make out what do you mean, the patch description is much\n> clearer, paradoxically.\n\nIt is hard to explain such a strange behaviour with a description that\nis both short and generic enough... But I agree with you. I just got\nbitten by this and I thought it was important enough to be specified.\n\n> Also, this in fact holds for the root tree\n> instead of the parent tree, and the behaviour changes from \"weird\" to\n> \"simply broken\" when you try to list a tree object that is _not_ the\n> root project tree from within a subdirectory:\n>\n>        git$ git ls-tree HEAD Documentation\n>        040000 tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1    Documentation\n>        git/Documentation$ git ls-tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1\n>        git/Documentation$\n>\n> I think that ls-tree simply shouldn't auto-fill its pathspec based on\n> current prefix in case no pathspec was supplied. Patch to follow.\n\nI also thought this behaviour was broken. But I didn't want to patch\nit because I was afraid of breaking things that would rely on it,\ndespite it seems unexpected enough not to be used...\n"},{"id":"84102","messageId":"7vy73w16nj.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080720230846.GH32184@machine.or.cz","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T23:24:00Z","receivedAt":"2008-07-20T23:24:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> I think that ls-tree simply shouldn't auto-fill its pathspec based on\n> current prefix in case no pathspec was supplied. Patch to follow.\n\nHave you dug the list archive from mid-to-late December 2005 that prompted\nthe current behaviour (and introduction of --full-name)?  I haven't.  A\nchange to always do the --full-name can only be justified by doing so and\nrehashing the issues.\n\nOn the other hand, \"fix\" is welcome.\n\n\n\t\n"},{"id":"84103","messageId":"20080720233956.GH10151@machine.or.cz","threadId":"14552","inReplyTo":"7vy73w16nj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-20T23:39:56Z","receivedAt":"2008-07-20T23:39:56Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jul 20, 2008 at 04:24:00PM -0700, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > I think that ls-tree simply shouldn't auto-fill its pathspec based on\n> > current prefix in case no pathspec was supplied. Patch to follow.\n> \n> Have you dug the list archive from mid-to-late December 2005 that prompted\n> the current behaviour (and introduction of --full-name)?  I haven't.  A\n> change to always do the --full-name can only be justified by doing so and\n> rehashing the issues.\n> \n> On the other hand, \"fix\" is welcome.\n\nYou are right, now that I understand the issue better, there's no good\nfix for this except perhaps introducing --no-prefix, which is not my\nitch to scratch. Here's my original wording improvement:\n\n\tNote that if you are within a subdirectory of your working copy,\n\t'git ls-tree' will automatically prepend the subdirectory prefix\n\tto the specified paths, and assume the prefix specified in case\n\tno paths were given - no matter what the tree object is! Thus,\n\twithin a subdirectory, 'git ls-tree' behaves as expected only\n\twhen run on a root tree object.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84104","messageId":"7vtzek15b5.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"7vy73w16nj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T23:53:02Z","receivedAt":"2008-07-20T23:53:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Petr Baudis <pasky@suse.cz> writes:\n>\n>> I think that ls-tree simply shouldn't auto-fill its pathspec based on\n>> current prefix in case no pathspec was supplied. Patch to follow.\n>\n> Have you dug the list archive from mid-to-late December 2005 that prompted\n> the current behaviour (and introduction of --full-name)?  I haven't.\n\nNow, I did:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/13028/focus=13135\n\nI think the answer is --full-name (cf. a69dd58 (ls-tree: chomp leading\ndirectories when run from a subdirectory, 2005-12-23)).\n"},{"id":"84108","messageId":"20080721000824.GI10151@machine.or.cz","threadId":"14552","inReplyTo":"7vtzek15b5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-21T00:08:24Z","receivedAt":"2008-07-21T00:08:24Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jul 20, 2008 at 04:53:02PM -0700, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Petr Baudis <pasky@suse.cz> writes:\n> >\n> >> I think that ls-tree simply shouldn't auto-fill its pathspec based on\n> >> current prefix in case no pathspec was supplied. Patch to follow.\n> >\n> > Have you dug the list archive from mid-to-late December 2005 that prompted\n> > the current behaviour (and introduction of --full-name)?  I haven't.\n> \n> Now, I did:\n> \n>     http://thread.gmane.org/gmane.comp.version-control.git/13028/focus=13135\n> \n> I think the answer is --full-name (cf. a69dd58 (ls-tree: chomp leading\n> directories when run from a subdirectory, 2005-12-23)).\n\nI don't understand your point now.  --full-name cares only about the\ndisplaying part; do you suggest that it should be extended to also turn\noff prepending the prefix during the filtering phase? That would make a\nlot of sense, if you are not worried about compatibility trouble.\n\n-- \n\t\t\tPetr \"Pasky, missing something\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84109","messageId":"7vljzw14br.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080721000824.GI10151@machine.or.cz","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-21T00:14:16Z","receivedAt":"2008-07-21T00:14:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> I don't understand your point now.  --full-name cares only about the\n> displaying part; do you suggest that it should be extended to also turn\n> off prepending the prefix...\n\nAh, sorry, I thought you were talking about the display part.\n\nI never thought you would think \"showing relative to tree-root\" is even an\noption.  That would make it inconsistent with not just the established\nsemantics of what the plumbing did, but also with what ls-files does.\n"},{"id":"84112","messageId":"20080721002248.GJ10151@machine.or.cz","threadId":"14552","inReplyTo":"7vljzw14br.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-21T00:22:48Z","receivedAt":"2008-07-21T00:22:48Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jul 20, 2008 at 05:14:16PM -0700, Junio C Hamano wrote:\n> I never thought you would think \"showing relative to tree-root\" is even an\n> option.\n\nI assume you mean \"not filtering relative to tree-root\"?\n\n> That would make it inconsistent with not just the established\n> semantics of what the plumbing did, but also with what ls-files does.\n\nBut ls-files always works on the index; ls-tree can work on trees,\nand when you're inspecting a non-root tree object from within\na subdirectory, this behaviour can be rather unexpected. But as I said,\nI'm fine with just documenting it.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84135","messageId":"7vljzvyi5w.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080721002248.GJ10151@machine.or.cz","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-21T04:28:59Z","receivedAt":"2008-07-21T04:28:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> On Sun, Jul 20, 2008 at 05:14:16PM -0700, Junio C Hamano wrote:\n>> I never thought you would think \"showing relative to tree-root\" is even an\n>> option.\n>\n> I assume you mean \"not filtering relative to tree-root\"?\n\nSorry, I may have been unclear.  I meant \"showing relative to tree-root,\nunlike showing relative to cwd like we have done forever\".\n\nChanging the behaviour would affect usage like this:\n\n\t$ cd some/where\n        $ git ls-files\n        $ git ls-tree --name-only -r HEAD^\n\n    cf. http://thread.gmane.org/gmane.comp.version-control.git/13028/focus=13080\n"},{"id":"84152","messageId":"20080721074728.GM10151@machine.or.cz","threadId":"14552","inReplyTo":"7vljzvyi5w.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add a notice to the doc of git-ls-tree.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-21T07:47:28Z","receivedAt":"2008-07-21T07:47:28Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jul 20, 2008 at 09:28:59PM -0700, Junio C Hamano wrote:\n> Sorry, I may have been unclear.  I meant \"showing relative to tree-root,\n> unlike showing relative to cwd like we have done forever\".\n> \n> Changing the behaviour would affect usage like this:\n> \n> \t$ cd some/where\n>         $ git ls-files\n>         $ git ls-tree --name-only -r HEAD^\n> \n>     cf. http://thread.gmane.org/gmane.comp.version-control.git/13028/focus=13080\n\n  Yes, as I said, by now I agree that this is not acceptable, and thus\nopted for just documenting the behaviour. :-)\n\n\t\t\t\tPetr \"Pasky\" Baudis\n"},{"id":"84154","messageId":"20080721075618.14163.45309.stgit@localhost","threadId":"14552","inReplyTo":"20080720233956.GH10151@machine.or.cz","subject":"[PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-21T07:56:34Z","receivedAt":"2008-07-21T07:56:34Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"When run in a working copy subdirectory, git-ls-tree will automagically\nadd the prefix to the pathspec, which can result in an unexpected behavior\nwhen the tree object accessed is not the root tree object.\n\nThis was originally pointed out and described in a patch by\nSteve Frénaux <code@istique.net>, this is a shot at clearer and more\naccurate description.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-ls-tree.txt |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt\nindex 1cdec22..8bb1864 100644\n--- a/Documentation/git-ls-tree.txt\n+++ b/Documentation/git-ls-tree.txt\n@@ -21,6 +21,15 @@ though - 'paths' denote just a list of patterns to match, e.g. so specifying\n directory name (without '-r') will behave differently, and order of the\n arguments does not matter.\n \n+Note that within a subdirectory of the working copy, 'git ls-tree'\n+will automatically prepend the subdirectory prefix to the specified\n+paths and assume just the prefix was specified in case no paths were\n+given --- no matter what the tree object is!\n+Thus, within a subdirectory, 'git ls-tree' behaves as expected\n+only when run on a root tree object (e.g. with a 'HEAD' tree-ish,\n+but not anymore when passed 'HEAD:Documentation' instead).\n+\n+\n OPTIONS\n -------\n <tree-ish>::\n"},{"id":"84155","messageId":"7v1w1nvf7q.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080721075618.14163.45309.stgit@localhost","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-21T08:00:57Z","receivedAt":"2008-07-21T08:00:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> +Note that within a subdirectory of the working copy, 'git ls-tree'\n> +will automatically prepend the subdirectory prefix to the specified\n> +paths and assume just the prefix was specified in case no paths were\n> +given --- no matter what the tree object is!\n\nDon't be negative upfront.  Explain why this is a good thing first.\n\n\t... were given.  This is useful when you are deep in a\n\tsubdirectory and want to inspect the list of files in an arbitrary\n\tcommit.  E.g.\n\n\t\t$ cd some/deep/path\n\t\t$ git ls-tree --name-only -r HEAD~20\n\n\twill list the files in some/deep/path (i.e. where you are) 20\n\tcommits ago, just like running \"/bin/ls\" there will give you the\n\tlist of files you have right now.\n\n> +Thus, within a subdirectory, 'git ls-tree' behaves as expected\n> +only when run on a root tree object (e.g. with a 'HEAD' tree-ish,\n> +but not anymore when passed 'HEAD:Documentation' instead).\n> +\n> +\n>  OPTIONS\n>  -------\n>  <tree-ish>::\n"},{"id":"84160","messageId":"f35478f50807210145r6a6fced3n2a7047f00d44b4d3@mail.gmail.com","threadId":"14552","inReplyTo":"20080721075618.14163.45309.stgit@localhost","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Steve Frécinaux","fromEmail":"nudrema@gmail.com","sentAt":"2008-07-21T08:45:52Z","receivedAt":"2008-07-21T08:45:52Z","isPatch":true,"sender":{"key":"nudrema@gmail.com","avatar":null},"body":"On Mon, Jul 21, 2008 at 9:56 AM, Petr Baudis <pasky@suse.cz> wrote:\n> This was originally pointed out and described in a patch by\n> Steve Frénaux <code@istique.net>, this is a shot at clearer and more\n> accurate description.\n\nThere is a typo in my name ;-)\n"},{"id":"84240","messageId":"20080721210452.GP10151@machine.or.cz","threadId":"14552","inReplyTo":"7v1w1nvf7q.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-21T21:04:52Z","receivedAt":"2008-07-21T21:04:52Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Mon, Jul 21, 2008 at 01:00:57AM -0700, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > +Note that within a subdirectory of the working copy, 'git ls-tree'\n> > +will automatically prepend the subdirectory prefix to the specified\n> > +paths and assume just the prefix was specified in case no paths were\n> > +given --- no matter what the tree object is!\n> \n> Don't be negative upfront.  Explain why this is a good thing first.\n> \n> \t... were given.  This is useful when you are deep in a\n> \tsubdirectory and want to inspect the list of files in an arbitrary\n> \tcommit.  E.g.\n> \n> \t\t$ cd some/deep/path\n> \t\t$ git ls-tree --name-only -r HEAD~20\n> \n> \twill list the files in some/deep/path (i.e. where you are) 20\n> \tcommits ago, just like running \"/bin/ls\" there will give you the\n> \tlist of files you have right now.\n\nFrankly, I think this is overdoing it. I'm all for being positive, but\nit is obvious why this is good thing when you inspect a root tree and\nthere's no need to be too wordy about it - it should be enough to\nacknowledge this later by the \"as expected\" as I note below.\n\nThe documentation should be detailed and complete, but not too chatty,\nor it gets too hard to read again.\n\n> > +Thus, within a subdirectory, 'git ls-tree' behaves as expected\n> > +only when run on a root tree object (e.g. with a 'HEAD' tree-ish,\n> > +but not anymore when passed 'HEAD:Documentation' instead).\n> > +\n> > +\n> >  OPTIONS\n> >  -------\n> >  <tree-ish>::\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84257","messageId":"7vd4l6sqqz.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080721210452.GP10151@machine.or.cz","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-22T00:32:20Z","receivedAt":"2008-07-22T00:32:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> \tcommit.  E.g.\n>> \n>> \t\t$ cd some/deep/path\n>> \t\t$ git ls-tree --name-only -r HEAD~20\n>> \n>> \twill list the files in some/deep/path (i.e. where you are) 20\n>> \tcommits ago, just like running \"/bin/ls\" there will give you the\n>> \tlist of files you have right now.\n>\n> Frankly, I think this is overdoing it. I'm all for being positive, but\n> it is obvious why this is good thing when you inspect a root tree and\n> there's no need to be too wordy about it...\n\nI mildly disagree.\n\nIf the person had truly understood that, why do we even have this thread\nto begin with?\n\nDescription on *what* it does (i.e. \"like what ls -a does in the current\nworking directory\" we have in the Description section) obviously was not\ngood enough.  It will be better understood if you describe *why* it does\nit that way at the same time.\n"},{"id":"84391","messageId":"20080722224759.GJ32184@machine.or.cz","threadId":"14552","inReplyTo":"7vd4l6sqqz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-22T22:47:59Z","receivedAt":"2008-07-22T22:47:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Mon, Jul 21, 2008 at 05:32:20PM -0700, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> >> \tcommit.  E.g.\n> >> \n> >> \t\t$ cd some/deep/path\n> >> \t\t$ git ls-tree --name-only -r HEAD~20\n> >> \n> >> \twill list the files in some/deep/path (i.e. where you are) 20\n> >> \tcommits ago, just like running \"/bin/ls\" there will give you the\n> >> \tlist of files you have right now.\n> >\n> > Frankly, I think this is overdoing it. I'm all for being positive, but\n> > it is obvious why this is good thing when you inspect a root tree and\n> > there's no need to be too wordy about it...\n> \n> I mildly disagree.\n\nWe may throw a dice or go with your version, I don't care *that* much\nabout this change, I just wouldn't make it personally.\n\n> If the person had truly understood that, why do we even have this thread\n> to begin with?\n\nTo nudge the person to the \"aha\" moment.\n\n> Description on *what* it does (i.e. \"like what ls -a does in the current\n> working directory\" we have in the Description section) obviously was not\n> good enough.\n\nI don't understand; what does auto-prefixing have to do with the\n\"ls -a\" mention?\n\n> It will be better understood if you describe *why* it does\n> it that way at the same time.\n\nMy version implies that for examining the root tree, without surplusage.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"85215","messageId":"20080728004604.GF32184@machine.or.cz","threadId":"14552","inReplyTo":"20080722224759.GJ32184@machine.or.cz","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-28T00:46:04Z","receivedAt":"2008-07-28T00:46:04Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Wed, Jul 23, 2008 at 12:47:59AM +0200, Petr Baudis wrote:\n> On Mon, Jul 21, 2008 at 05:32:20PM -0700, Junio C Hamano wrote:\n> > Petr Baudis <pasky@suse.cz> writes:\n> > \n> > >> \tcommit.  E.g.\n> > >> \n> > >> \t\t$ cd some/deep/path\n> > >> \t\t$ git ls-tree --name-only -r HEAD~20\n> > >> \n> > >> \twill list the files in some/deep/path (i.e. where you are) 20\n> > >> \tcommits ago, just like running \"/bin/ls\" there will give you the\n> > >> \tlist of files you have right now.\n> > >\n> > > Frankly, I think this is overdoing it. I'm all for being positive, but\n> > > it is obvious why this is good thing when you inspect a root tree and\n> > > there's no need to be too wordy about it...\n> > \n> > I mildly disagree.\n> \n> We may throw a dice or go with your version, I don't care *that* much\n> about this change, I just wouldn't make it personally.\n\nWhat is the status of this patch? :-) Dropped altogether?\n\n\t\t\t\tPetr \"Pasky\" Baudis\n"},{"id":"85226","messageId":"7vvdyqx0i0.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"20080728004604.GF32184@machine.or.cz","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-28T01:26:15Z","receivedAt":"2008-07-28T01:26:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> We may throw a dice or go with your version, I don't care *that* much\n>> about this change, I just wouldn't make it personally.\n>\n> What is the status of this patch? :-) Dropped altogether?\n\nLeft behind on the far side of oblivion; I do not offhand recall what this\nwas about, sorry.\n"},{"id":"85263","messageId":"7vabg2s6ot.fsf@gitster.siamese.dyndns.org","threadId":"14552","inReplyTo":"7vvdyqx0i0.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-28T09:23:46Z","receivedAt":"2008-07-28T09:23:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Petr Baudis <pasky@suse.cz> writes:\n>\n>>> We may throw a dice or go with your version, I don't care *that* much\n>>> about this change, I just wouldn't make it personally.\n>>\n>> What is the status of this patch? :-) Dropped altogether?\n>\n> Left behind on the far side of oblivion; I do not offhand recall what this\n> was about, sorry.\n\nOk, I now recall this bit:\n\n        You are right, now that I understand the issue better, there's no good\n        fix for this except perhaps introducing --no-prefix, which is not my\n        itch to scratch. Here's my original wording improvement:\n\n                Note that if you are within a subdirectory of your working copy,\n                'git ls-tree' will automatically prepend the subdirectory prefix\n                to the specified paths, and assume the prefix specified in case\n                no paths were given - no matter what the tree object is! Thus,\n                within a subdirectory, 'git ls-tree' behaves as expected only\n                when run on a root tree object.\n\nEventually somebody may write a Porcelain that benefits from --no-prefix,\nbut it is safe to defer the implementation until the need becomes real.\n\nI'll add some explanatory message to the documentation.\n"}]}