summaryrefslogtreecommitdiff
path: root/doc/todo/operate_on_branch_contents.mdwn
blob: eb2f009120e62884404772425ae3a595cc7289f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Currently, commands can operate on specific files in the working tree,
or on all known keys, or on a specific key. It would be useful to have
something like `--branch foo` which would operate on the files present in
the specified branch.

For example, this would be useful in bare repos to fsck only the master
branch, and not all versions of all keys.

It might be worth allowing a full refspec, so that eg `refs/remotes/*/master`
or `refs/tags/*` can be operated on. --[[Joey]]

> This should be pretty easy to implement, using `git ls-tree`
> to enumerate the contents of the ref.
> 
> The wrinkle is that for --all, the name of each key is shown as it's
> operated on. But in this case, we want to instead display something like
> "ref:filename".
> 
> So, every command that supports --branch (which probably
> should be all the ones currently supporting --all) will need to be
> modified, to be provided some new data type that is not FilePath to a
> work tree file, but something to display while operating on an item.
> 
> Not a hard change to make, but an extensive one. --[[Joey]]

>> I've implemented the first part of this, so --branch works
>> but the name of the key is shown, rather than the file from the branch.
>> --[[Joey]]