bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff "--git"


From: Paolo Bonzini
Subject: Re: diff "--git"
Date: Fri, 19 Feb 2010 08:15:36 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1

On 02/18/2010 03:45 PM, Alfred M. Szmidt wrote:
    $ diff --git
    diff: unrecognized option '--git'

    I think diff should say at this point "real diff, at least up to year
    2010, does not have a --git option, you are probably getting that idea
    from git output" or something.

That is what it says, though not in so many words.  Having an option
for each VS would really be a headache (SCCS, RCS, CVS, hg, darcs,
bzr, tla, git, ...).

On the contrary, I think we could make a stab at implementing "diff --git": prepend a/ and b/ in some way to the paths(*), outputting create/delete if one of the comparands is /dev/null, printing changes in mode. The only part that we shouldn't care about is the index.

   (*) example: if the paths are entirely the same, print a/SECOND/PATH
   and b/SECOND/PATH, if they are different, replace the first element
   of each path with a/ and b/ respectively.

Dually, patch would recognize changes in mode and apply them.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]