All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH v3] Add log.abbrevCommit config variable
Date: Tue, 17 May 2011 11:50:47 -0700	[thread overview]
Message-ID: <7vy625f9fc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1305413341-56450-1-git-send-email-jaysoffian@gmail.com> (Jay Soffian's message of "Sat, 14 May 2011 18:49:01 -0400")

Jay Soffian <jaysoffian@gmail.com> writes:

> @@ -137,6 +139,12 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
>  	    && rev->commit_format == CMIT_FMT_RAW)
>  		decoration_style = 0;
>  
> +	/* ditto for log.abbrevCommit */
> +	if (!rev->abbrev_commit_given && rev->abbrev_commit
> +	    && rev->commit_format == CMIT_FMT_RAW)
> +		rev->abbrev_commit = 0;
> +
> +

This is not exactly "ditto"; the lines before this hunk look like this:

	/*
	 * defeat log.decorate configuration interacting with --pretty=raw
	 * from the command line.
	 */
	if (!decoration_given && rev->pretty_given
	    && rev->commit_format == CMIT_FMT_RAW)
		decoration_style = 0;

The check for pretty-given and commit-format being raw is to catch only
the case where the command line said --pretty=raw, excluding any case the
commit-format is set to raw without any explicit --pretty=raw on the
command line.  So at the logical level, this one should be read as if it
was written like this:

	if (rev->pretty_given && rev->commit_format == CMIT_FMT_RAW) {
        	/* "log --pretty=raw" is special */
        	if (!decoration_given)
			decoration_style = 0;
	}

even though the existing one makes it look as if checking decoration-given
and pretty-given together when commit-format is set to raw.

Care to explain why your check has to be different?  If there is no reason
to use a different logic, then a natural thing to do is to rewrite the
existing decoration logic and add yours like this:

	if (rev->pretty_given && rev->commit_format == CMIT_FMT_RAW) {
        	/* "log --pretty=raw" is special */
        	if (!decoration_given)
			decoration_style = 0;
		if (!abbrev_commit_given)
			rev->abbrev_commit = 0;
	}

  parent reply	other threads:[~2011-05-17 18:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-14 17:22 [PATCH] Add log.abbrev-commit config option Jay Soffian
2011-05-14 17:26 ` Jay Soffian
2011-05-14 19:01 ` Jonathan Nieder
2011-05-14 19:35   ` Jay Soffian
2011-05-14 20:19     ` [PATCH] add, merge, diff: do not use strcasecmp to compare config variable names Jonathan Nieder
2011-05-15  1:53       ` Junio C Hamano
2011-05-14 20:47   ` [PATCH v2] Add log.abbrevCommit config variable Jay Soffian
2011-05-14 21:55     ` Jonathan Nieder
2011-05-14 22:22       ` Jay Soffian
2011-05-14 22:49         ` [PATCH v3] " Jay Soffian
2011-05-15 13:25           ` Jay Soffian
2011-05-15 22:42           ` Junio C Hamano
2011-05-16  5:53             ` Jay Soffian
2011-05-16  7:00               ` Jonathan Nieder
2011-05-16  7:18                 ` Jay Soffian
2011-05-17 17:03                 ` Junio C Hamano
2011-05-17 21:50                   ` Junio C Hamano
2011-05-18  1:05                     ` Jay Soffian
2011-05-17 18:50           ` Junio C Hamano [this message]
2011-05-17 19:08             ` Jay Soffian
2011-05-15  1:48   ` [PATCH] Add log.abbrev-commit config option Junio C Hamano
2011-05-16  8:24     ` Michael J Gruber

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=7vy625f9fc.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=jrnieder@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.