Re: Passing revs to git-bundle-create via stdin
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 24, 2017, 01:44 UTC
- Message-ID
- <xmqqwp97hvvi.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170523164641.u3rd7bgc7ifvu2su@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> I think what's happening is that git-bundle actually runs _two_ > traversals using the command-line arguments. ... > ... It was just a way of confirming my > guess about the double-read. > > The real solutions I can think of are: > > 1. Teach git-bundle not to require the double-read. I'm not sure why > it's written the way it is, but presumably it would be tricky to > undo it (or we would have just written it the other way in the > first place!)
If I remember correctly, the reason why it does the double-read is because it wants to cope with things like "--since". There is no explicit bottom of the DAG specified on the command line, and the first one (without "--objects") is done to find "prerequisites" that are written in the header.
Then the packdata is generated, which does another traversal (this time with "--objects" option).
So perhaps the right way to fix it is to keep the first traversal as-is, but update the second one (I think write-bundle-refs is the culprit) so that it does not use the user-supplied command line as-is; instead it should use the positive end of the history from the command line with the negative end set to these "prerequisites" commits.
I said "command line" in the above, but read that as "end user input"; the list of rev-list command line arguments given from the standard input is exactly the same deal.