git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Pavlic <ted@tedpavlic.com>
To: Keith Cascio <keith@CS.UCLA.EDU>
Cc: Teemu Likonen <tlikonen@iki.fi>, git <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: diff settings
Date: Sun, 25 Jan 2009 21:06:47 -0500	[thread overview]
Message-ID: <497D1AB7.7000208@tedpavlic.com> (raw)
In-Reply-To: <alpine.GSO.2.00.0901251307030.12651@kiwi.cs.ucla.edu>

>> Mercurial has a "defaults.*" that does exactly what you want. That is, you can
>> [defaults]
>> diff = -w
>> and "hg diff" will automatically do "hg diff -w". Such a feature might be a
>> nice addition to git.
> Thank you, that is very interesting.  I just submitted a patch this morning that
> does exactly what you describe, but I called it "primer" instead of "defaults"
> because it seemed more explicit.  Check it out.

I saw that. However, in Mercurial's case, the [defaults] section applies 
to all commands (including new ones introduced by extensions). That is, 
it looks like your patch adds a diff.primer, but Mercurial would add a 
primer.* that allows you to have a primer.diff, primer.commit, etc.

For example, wouldn't it be nice to have something like...

[defaults]
diff = -w
commit = -a

etc.? Right now the only way you can do that is with aliases (e.g., I 
have an alias from "ci" to "commit -a").

This task is pretty easy in Mercurial because Mercurial porcelains are 
implemented as modules that are all executed through the central "hg" 
command. This isn't the case with git.

(on a somewhat unrelated note, Mercurial does have a [diff] section that 
allows for, say, forcing the use of git diff and other things)

--Ted



-- 
Ted Pavlic <ted@tedpavlic.com>

   Please visit my ALS association page:
         http://web.alsa.org/goto/tedpavlic
   My family appreciates your support in the fight to defeat ALS.

  reply	other threads:[~2009-01-26  2:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 17:38 diff settings Keith Cascio
2009-01-24 19:22 ` Jeff King
2009-01-24 19:33 ` Teemu Likonen
2009-01-24 20:01   ` Keith Cascio
2009-01-25 21:02     ` Ted Pavlic
2009-01-25 21:11       ` Keith Cascio
2009-01-26  2:06         ` Ted Pavlic [this message]
2009-01-29 16:26           ` Ted Pavlic
2009-01-29 16:33             ` Johannes Schindelin
2009-01-29 18:46               ` Keith Cascio
2009-01-29 21:07                 ` Nanako Shiraishi
     [not found]           ` <alpine.GSO.2.00.0901310750470.5437@kiwi.cs.ucla.edu>
2009-01-31 19:47             ` Ted Pavlic
2009-01-31 23:10               ` Keith Cascio

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=497D1AB7.7000208@tedpavlic.com \
    --to=ted@tedpavlic.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=keith@CS.UCLA.EDU \
    --cc=tlikonen@iki.fi \
    /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).