Re: [PATCH] fast-import: add 'ls' command
From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:09
Sverre Rabbelier wrote:
On Thu, Dec 2, 2010 at 11:40, David Barr [off-list ref] wrote:
quoted
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