From: Jeff King Date: Wed, 25 Nov 2015 09:07:47 GMT Subject: Re: Suspected bug on `git -C rev-list --all` where has 0 commits Message-ID: <20151125090746.GC4696@sigill.intra.peff.net> In-Reply-To: On Tue, Nov 24, 2015 at 10:56:50PM -0800, Atousa Duprat wrote: > 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