Re: Suspected bug on `git -C <rp> rev-list --all` where <rp> has 0 commits
- From
Jeff King <peff@peff.net>
- Date
- Nov 25, 2015, 09:07 UTC
- Message-ID
- <20151125090746.GC4696@sigill.intra.peff.net>
- In-Reply-To
- <CA+izobv6OuAAjnKH5A=vcmJh3yDhWi41WAD-OmVSN2d7P_5SGA@mail.gmail.com>
On Tue, Nov 24, 2015 at 10:56:50PM -0800, Atousa Duprat wrote:
Show 5 quoted lines
> I agree with Yac that this error is unwarranted, though it's been like > that since forever. > If a repo is empty, git rev-list should probably just return without > erroring out. > The fix is trivial, if the list agrees that this is in fact legit.
I think we had a similar discussion for "git log" with an empty HEAD, and decided that it was better to keep the behavior the same for compatibility reasons. I think that would apply doubly for rev-list, which is used by scripts.
In the "log" case, we did improve the error message:
$ git init $ git.v2.5.0 log fatal: bad default revision 'HEAD' $ git.v2.6.3 log fatal: your current branch 'master' does not have any commits yet
Maybe a good first step would be improving the error message?
-Peff