Greg Troxel <
g...@lexort.com> writes:
> I am not understanding.
>
> - Is this with --repair only (and if so, only if actually repair=ed)
It's any invocation of "bup get" with multiple targets, i.e. multiple
--picks, --appends, etc. For example, If the destination has a "branch"
HASH and you --pick branch/save-1 --pick branch/save-2 --pick
branch/save-3 from somewhere, I believe it will create three new
commits, each with HASH as the parent, and then update the destination
branch to be the last one. Assuming that's right, the intermediate
commits (and their attached data) are in the repository, but detached.
Internally, this is due to a problem with bup get's attempt to make the
invocation more atomic with respect to refs. Right now it attempts to
defer all ref updates until the end, and only if all operations succeed.
One question we're wondering about right now, is how important is it
that bup get have deferred ref updates. It would be fairly easy to
"fix" the problem by changing get to just update the refs as it goes.
Fixing the problem while preserving the deferral is going to be more
complicated, and has higher risk of getting something wrong now, or in
future changes (because bup has to simulate the ref changes during the
process, to be careful with respect to the VFS (and its caching)), but
it is a nice behavior when you need it. Of course you could also handle
that yourself, outside of bup, by capturing the relevant refs with "git
show-ref ...", and then rolling back on error via "git branch -f ...".
I still have some investigation to do, but if someone were to want a
quick local fix, then putting something like this at the top of
lib/bup/cmd/get.py get_everything() may work:
if len(opt.target_specs > 1):
misuse('only one method allowed per invocation until a bug is fixed')
That will also cause some of the tests to fail.
> That sounds fine to me.
>
> Would there also be a new test to detect the bug?
Definitely. (I'm unpleasantly surprised none of the existing tests
caught this, either intentionally or incidentally.)
> Does this affect get --rewrite?
Yes (at least) any invocation of bup get that should be "chaining" more
than one commit(ish) to a target branch, and unfortunately, the
workaround is likely to make --rewrite/--repair of multiple saves (on
the same or related branches) much slower because the database of
"previous rewrites" won't be available across the saves (it's per bup
invocation).