Hi, Jeff. On Fri, Sep 19, 2008 at 7:25 AM, Jeff King <peff@xxxxxxxx> wrote: > I'm not sure that's the same as "--root", though. In existing --root > cases, we are saying "pretend that beyond the initial commit, there is a > commit that contains the empty tree". The logical extension of git-log > here would be to print out that commit. Well yeah, agree. My proposal differs from --root meaning and what you are doing in your patch. So let's continue this 'git log' discussion without relation to your changes. > Not to mention that "git log --root" _already_ has defined semantics > (you just don't really need it since log.showroot defaults to true). Hm.. anatol:opensource $ mkdir ex anatol:opensource $ cd ex/ anatol:ex $ git init Initialized empty Git repository in /personal/sources/opensource/ex/.git/ anatol:ex $ git log fatal: bad default revision 'HEAD' anatol:ex $ git config log.showroot true anatol:ex $ git config log.showroot true anatol:ex $ git log fatal: bad default revision 'HEAD' anatol:ex $ git config core.showroot true anatol:ex $ git config core.showroot true anatol:ex $ git log fatal: bad default revision 'HEAD' I dont see how does log.showroot or core.showroot affect 'git log'. man git-log says nothing, git-config only mentions that initial commit is "a big creation event". > I wonder if my patch is actually confusing things more, and the right > solution is an option that says "pretend that a non-existant HEAD is a > commit with no log and the empty tree." But I think that may just be > confusing things more, because the semantics of such a null commit > wouldn't be clear (e.g., git log would actually produce a little bit of > output). Yeap - probably it would confuse even more, that is why I brought it for discussion :) But for me as for person that still actively works with Subversion it was quite surprising that I have error messages right after I created a fresh empty repo. I always thought that "Empty repo" -> "No history" -> "No log output" Subversion in the same situation. anatol:2 $ svn info | grep Revision Revision: 0 anatol:2 $ svn log ------------------------------------------------------------------------ So svn has the same notion of Initial commit which is "big creation event" but not visible in "svn log" The difference from git is that init git repo has no HEAD. HEAD is undefined. Would it be better if absence of HEAD would mean the same as "HEAD points to the initial commit". > Maybe it really is better to just force the caller to check the initial > commit condition. It's more work for them, but the semantics are simple > and unambiguous. What is the best way to check that repo has valid HEAD? Check that file .git/HEAD exists? -- anatol -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html