git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Anatol Pomozov <anatol.pomozov@gmail.com>,
	sverre@rabbelier.nl, Git Mailing List <git@vger.kernel.org>
Subject: Re: Re* [RFC/PATCH] extend meaning of "--root" option to index comparisons
Date: Sun, 21 Sep 2008 09:56:16 -0400	[thread overview]
Message-ID: <20080921135616.GA25238@sigill.intra.peff.net> (raw)
In-Reply-To: <7vskrvswxp.fsf@gitster.siamese.dyndns.org>

On Fri, Sep 19, 2008 at 01:27:46PM -0700, Junio C Hamano wrote:

>  (1) A user getting an error message from "git init && git log" may be
>      annoyed, but he very well knows there is no history yet _anyway_.
>      This initial annoyance will pass immediately after creating any
>      commit, so I do not think it is a big issue.

I think there is an additional case of script writers, who want their
scripts to fail gracefully or otherwise do the right thing with an
initial commit. Right now they have to special-case the initial commit.
I don't know if it is possible to have sane enough behavior that the
special case can be eliminated, or if it will simply make things worse.

>      "bad default revision 'HEAD'" is a cryptic way to give that indicaion
>      that can be improved but that is a separate issue.  Rewording it so
>      that it explains the situation better in user's terms would be a
>      worthy improvement.

I agree that would be an improvement.

>  (2) "--root" is about "do we show a creation event as a huge diff from
>      emptyness?".  Yes, we turn it on for "git log" but it does not have
>      anything to do with the issue of yet to be born branch, where there
>      isn't even a big creation event yet.

What about index comparisons? What should an index comparison to a
branch yet-to-be-born look like? Right now it is an error.

> I am reluctant to agree with the opinion that "git log" should be _silent_
> in a world without any history.

It feels a bit more Unix-y to me. That is, if I am asking for some set
of commits, and there are _no_ commits in the set, then I expect no
output. That makes sense for text processing.

> -	argc = setup_revisions(argc, argv, rev, "HEAD");
> +	argc = setup_revisions(argc, argv, rev, NULL);
> +	if (!rev->pending.nr) {
> +		add_head_to_pending(rev);
> +		if (!rev->pending.nr) {
> +			printf("No commits (yet).\n");
> +			exit(0);
> +		}
> +	}

I like the idea of an improved message, but such a message should
definitely not go to stdout; it would feed nonsense to a command like
"git log | my_log_filter".

-Peff

  reply	other threads:[~2008-09-21 13:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-15 20:01 Diff-tree does not work for initial commit Anatol Pomozov
2008-09-15 20:49 ` Michael J Gruber
2008-09-15 20:54   ` Junio C Hamano
2008-09-15 21:48     ` Anatol Pomozov
2008-09-15 21:09   ` Michael J Gruber
2008-09-15 21:11   ` Sverre Rabbelier
2008-09-15 22:34     ` Jeff King
2008-09-16  6:19       ` Sverre Rabbelier
2008-09-16  6:21         ` Jeff King
2008-09-18  9:21           ` [RFC/PATCH] extend meaning of "--root" option to index comparisons Jeff King
2008-09-18 16:31             ` Anatol Pomozov
2008-09-18 16:51               ` Sverre Rabbelier
2008-09-19 14:25               ` Jeff King
2008-09-19 16:54                 ` Anatol Pomozov
2008-09-19 17:39                   ` Jeff King
2008-09-19 20:27                 ` Re* " Junio C Hamano
2008-09-21 13:56                   ` Jeff King [this message]
2008-09-21 15:58                     ` Anatol Pomozov
2008-09-21 17:04                       ` Jakub Narebski
2008-09-22 13:15                       ` Jeff King
2008-09-21 18:48                     ` Junio C Hamano
2008-09-22 13:32                       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080921135616.GA25238@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=anatol.pomozov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sverre@rabbelier.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).