git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff Muizelaar <jmuizelaar@mozilla.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add diff.context option to specify default context
Date: Fri, 14 Sep 2012 14:06:25 -0700	[thread overview]
Message-ID: <7vobl82u26.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <A74D9034-E5BA-4CD5-B621-1C388EF4CE2B@mozilla.com> (Jeff Muizelaar's message of "Fri, 14 Sep 2012 14:16:03 -0400")

Jeff Muizelaar <jmuizelaar@mozilla.com> writes:

> This adds a diff.context config option to allow specifying
> the number of lines of context. This is similar to Mercurial's
> 'unified' option.

Random thoughts.

* Please refer to Documentation/SubmittingPatches.  Saving your
  message in a mbox and applying it would produce this crap:

    commit ba4c972eacb91058f1317dbcd4ff77b471fa938e
    Author: Jeff Muizelaar <jmuizelaar@mozilla.com>
    Date:   Fri Sep 14 14:16:03 2012 -0400

        Add diff.context option to specify default context

        This adds a diff.context config option to allow specifying
        the number of lines of context. This is similar to Mercurial's
        'unified' option.

        commit 1bd81c75de6824c39852bc8516acd0733737ed83
        Author: Jeff Muizelaar <jmuizelaar@mozilla.com>
        Date:   Fri Sep 14 13:55:02 2012 -0400

            [PATCH] Add diff.context option to specify default context

            This adds a diff.context config option to allow specifying
            the number of lines of context. This is similar to
            Mercurial's
            'unified' option.

  which is not acceptable.

* Sign-off your patch.

* Citing similaritly to options in other systems does not add much
  value for people who read the proposed log message.  In this case,
  I think the first sentence is written clearly enough that it is
  sufficient without such clarification.  If anything, it should
  instead say:

	diff: diff.context configuration gives default to -U

	Introduce a configuration variable diff.context that tells
	Porcelain commands to use a non-default number of context
	lines instead of 3 (the default).  With this variable, users
	do not have to keep repeating "git log -U8" from the command
	line; instead, it becomes sufficient to say "git config
	diff.context 8" just once.

  or something like that to make it clear that it is related to our
  -U option.

* That relationship with the -U option may worth mentioning in the
  documentation, not just in the log message.

* The configuration is read only in diff_ui_config and not in the
  lower-level diff_config.  What the patch does is the right thing.

  It however needs to be documented in the patch to diff-config.txt
  that it affects only the Porcelain commands, and does not break
  plumbing commands.

* Tests?  Minimally, the cases you may want to check are:

  - What happens with various values set to this variable, and does
    the code properly diagnose errors?

    [diff]
	context ;# boolean?
        context = no
        context = 0
        context = -1
        context = 8

  - What happens when the variable is set and the command line gives
    a different value with -U?

    git config diff.context 8
    git log -U4 -1

  - Does it really keep plumbing intact?

    git config diff.context 8
    git diff-files -p


Thanks.

  reply	other threads:[~2012-09-14 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 18:16 [PATCH] Add diff.context option to specify default context Jeff Muizelaar
2012-09-14 21:06 ` Junio C Hamano [this message]
2012-09-27 15:04   ` [PATCH] diff: diff.context configuration gives default to -U Jeff Muizelaar
2012-09-27 17:40     ` Junio C Hamano
2012-09-27 18:43       ` Jeff King
2012-09-27 19:12       ` Jeff Muizelaar
2012-09-27 22:18         ` Junio C Hamano
2012-10-19 20:54           ` Jeff Muizelaar

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vobl82u26.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jmuizelaar@mozilla.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).