unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bzr: just give me a context diff, will you?
@ 2010-04-20 18:00 Alan Mackenzie
  2010-04-20 18:43 ` Stefan Monnier
  2010-04-20 18:45 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Mackenzie @ 2010-04-20 18:00 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs!

The project standard for diff output is a context diff, not a unified
diff.  By default, bzr unfortunately outputs unified.

For anybody else who finds typing "--diff-options='-c'" intolerably
long-winded, here is a quick hack in bzr to make context diffs the
default.  The file is ..../bzr-2.1.0/bzrlib/diff.py.


*** diff.py~	2010-02-16 17:00:21.000000000 +0000
--- diff.py	2010-04-20 17:42:45.059802592 +0000
***************
*** 868,873 ****
--- 868,878 ----
              extra_factories = [DiffFromTool.make_from_diff_tree(using)]
          else:
              extra_factories = []
+         
+         # Added 2010-04-20 to make context diffs the default.
+         if not external_diff_options:
+             external_diff_options = '-c'
+ 
          if external_diff_options:
              opts = external_diff_options.split()
              def diff_file(olab, olines, nlab, nlines, to_file):


-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bzr: just give me a context diff, will you?
  2010-04-20 18:00 bzr: just give me a context diff, will you? Alan Mackenzie
@ 2010-04-20 18:43 ` Stefan Monnier
  2010-04-20 18:45 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2010-04-20 18:43 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> The project standard for diff output is a context diff, not a unified
> diff.  By default, bzr unfortunately outputs unified.

> For anybody else who finds typing "--diff-options='-c'" intolerably
> long-winded,

You can set up such default options in your ~/.bazaar/bazaar.conf file.
E.g. the two lines below should do it.

	[ALIASES]
	diff=diff --diff-options=-c


-- Stefan "who prefers unified diffs"




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bzr: just give me a context diff, will you?
  2010-04-20 18:00 bzr: just give me a context diff, will you? Alan Mackenzie
  2010-04-20 18:43 ` Stefan Monnier
@ 2010-04-20 18:45 ` Eli Zaretskii
  2010-04-20 20:02   ` Andreas Schwab
  2010-04-22  9:50   ` Alan Mackenzie
  1 sibling, 2 replies; 5+ messages in thread
From: Eli Zaretskii @ 2010-04-20 18:45 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> Date: Tue, 20 Apr 2010 18:00:03 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> For anybody else who finds typing "--diff-options='-c'" intolerably
> long-winded, here is a quick hack in bzr to make context diffs the
> default.  The file is ..../bzr-2.1.0/bzrlib/diff.py.

You don't need to hack Bazaar to get this.  Just edit your
~/.bazaar/bazaar.conf file and add this:

[ALIASES]
diff=diff --diff-options -c

(If you already have the ALIASES section, you only need the second
line.)




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bzr: just give me a context diff, will you?
  2010-04-20 18:45 ` Eli Zaretskii
@ 2010-04-20 20:02   ` Andreas Schwab
  2010-04-22  9:50   ` Alan Mackenzie
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2010-04-20 20:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Alan Mackenzie, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 20 Apr 2010 18:00:03 +0000
>> From: Alan Mackenzie <acm@muc.de>
>> 
>> For anybody else who finds typing "--diff-options='-c'" intolerably
>> long-winded, here is a quick hack in bzr to make context diffs the
>> default.  The file is ..../bzr-2.1.0/bzrlib/diff.py.
>
> You don't need to hack Bazaar to get this.  Just edit your
> ~/.bazaar/bazaar.conf file and add this:
>
> [ALIASES]
> diff=diff --diff-options -c

$ bzr alias diff="diff --diff-options -c"

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bzr: just give me a context diff, will you?
  2010-04-20 18:45 ` Eli Zaretskii
  2010-04-20 20:02   ` Andreas Schwab
@ 2010-04-22  9:50   ` Alan Mackenzie
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2010-04-22  9:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Hi, Eli and everybody else,

On Tue, Apr 20, 2010 at 09:45:01PM +0300, Eli Zaretskii wrote:
> > Date: Tue, 20 Apr 2010 18:00:03 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > For anybody else who finds typing "--diff-options='-c'" intolerably
> > long-winded, here is a quick hack in bzr to make context diffs the
> > default.  The file is ..../bzr-2.1.0/bzrlib/diff.py.

> You don't need to hack Bazaar to get this.  Just edit your
> ~/.bazaar/bazaar.conf file and add this:

> [ALIASES]
> diff=diff --diff-options -c

> (If you already have the ALIASES section, you only need the second
> line.)

Thanks for this!  _Maybe_ R'ingTFM would have been faster than hacking
the source.

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-22  9:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 18:00 bzr: just give me a context diff, will you? Alan Mackenzie
2010-04-20 18:43 ` Stefan Monnier
2010-04-20 18:45 ` Eli Zaretskii
2010-04-20 20:02   ` Andreas Schwab
2010-04-22  9:50   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).