On the description of brancher it reads the following:
Yields:
str: the display name for the currently selected tree, it could be:
- a git revision identifier
- empty string it there is no branches to iterate over
- "Working Tree" if there are uncommited changes in the SCM repo
The relevant part is the last one, it should yield the "working tree" only if the repository is dirty.
It would be fixed with the following (under brancher.py):
if repo.scm.is_dirty():
yield "working tree"
I think this make sense, because for dvc metrics show it is annoying to see the "working tree" when there's no difference from the current branch.
@mroutis could you give more context please?
Sure, @shcheklein , let me edit the description :sweat_smile: .
@mroutis @Suor Is this still relevant? There was some dedup optimization in brancher.
@efiop , I'd say it is a priority 3 and more like an enhancement.
git init
dvc init
dvc run -m foo 'echo 100 > foo'
git add -A
git commit -m "metrics foo"
$ dvc metrics show --all-branches
working tree:
foo: 100
master:
foo: 100
So, the problem is that working tree is being returned when you can tell that there's no difference between the current branch and the working tree (because _the HEAD is clean_ -- not sure if I'm using the correct terminology :sweat_smile: )
Other approach is adding "working tree" with a comma, same as dup branches or tags.
Votes split on priority and whether include it into the next sprint: +1s from @mroutis and @Suor, -1 from @efiop and @pared.
Goes as bonus for next sprint if we go well.
Just discovered that --all-branches and friends are noop for dvc status when neither cloud nor remote option is specified. So:
metrics show, other commands don't care@Suor Indeed, it only affects status if -c is also specified. So need a group of mutually required (or whatever it is called) flags there.
Most helpful comment
@efiop , I'd say it is a priority 3 and more like an enhancement.
So, the problem is that
working treeis being returned when you can tell that there's no difference between the current branch and the working tree (because _the HEAD is clean_ -- not sure if I'm using the correct terminology :sweat_smile: )