Re: [PATCH] fast-import: add 'ls' command
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 2, 2010, 17:37 UTC
- Message-ID
- <20101202173722.GE3962@burratino>
- In-Reply-To
- <AANLkTi=HuPK+q_+hdkg4yK45UcoOA5PAGi4OmsojCsFa@mail.gmail.com>
Sverre Rabbelier wrote:
> On Thu, Dec 2, 2010 at 11:40, David Barr <david.barr@cordelta.com> wrote:
Show 9 quoted lines
>> There are two forms of the 'ls' command, one that takes a tree-ish and >> one relative to the index. Allow the tree-ish variant to be used anywhere >> a comment is allowed. Allow the index variant to be used within a commit >> where file change commands would be used. > > The commit message doesn't explain why the index variant isn't allowed > anywhere a comment is allowed. I assume that's because there's a > half-constructed index if you're in the middle of a modify operation > or such?
I somewhat agree. Actually I would go further: the word "index" brings to mind .git/index and its in-core counterpart, so at the same time as documenting it better, we might look into making it more self- explanatory. Maybe a syntax like
ls current "path/to/entry"
would make it clearer that this is about directory entries in fast-import's active commit and not necessarily the usual index file?
I am not sure what syntax other vcs-es use for tree-ishes. To avoid name clashes (what if 'current' is the low-level name of a tree-ish?), an alternative might be
ls-tree :11 "path/to/historical/entry" ls "path/to/current/entry"
Hm (just musing). Jonathan