bug-vc-dwim
[Top][All Lists]
Advanced

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

[Bug-vc-dwim] [PATCH] git diff may use prefixes other than a/ and b/.


From: Ralf Wildenhues
Subject: [Bug-vc-dwim] [PATCH] git diff may use prefixes other than a/ and b/.
Date: Thu, 21 Aug 2008 11:45:18 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* vc-chlog.in (func_extract_changed_lines): Accept
single-character prefixes other than `a/' and `b/' for diff file
names, for git.

Signed-off-by: Ralf Wildenhues <address@hidden>
---


First off, hello, and welcome dear reader, to this shiny new bug-vc-dwim
mailing list.  May there be more than only spam or void.

As to posting patches, I don't think it will be necessary to post all
kinds of trivial patches here (not that development is racing anyway),
but I thought this is a good opportunity to say "First!!1l!"  ;-)

Of course if you have questions, bug reports, ideas, want to help,
share your experiences with vc-dwim, you're more than welcome to do so
here.

Just in case you're wondering about the weird way in which this email is
formatted---first git log entry, then prose, then the rest of a patch---,
that's what 'git format-patch' outputs, and allows the mail to be piped
into 'git am' easily.

This particular patch adjusts vc-chlog for the stuff discussed here:
<http://thread.gmane.org/gmane.comp.version-control.git/92673/focus=92970>

I like to pipe the output of 'git diff' with various options (e.g.,
--cached) into 'vc-chlog --stdin', that's why this additional
flexibility is helpful.  I've just pushed this patch to master.

Cheers,
Ralf

 ChangeLog   |    6 ++++++
 vc-chlog.in |    5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8dc37f2..8f0507a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-21  Ralf Wildenhues  <address@hidden>
+
+       * vc-chlog.in (func_extract_changed_lines): Accept
+       single-character prefixes other than `a/' and `b/' for diff file
+       names, for git.
+
 2008-07-23  Jim Meyering  <address@hidden>
 
        tests: also accept bzr-1.3 and 1.4-based versions.
diff --git a/vc-chlog.in b/vc-chlog.in
index b0a93e3..38e3b2b 100755
--- a/vc-chlog.in
+++ b/vc-chlog.in
@@ -197,8 +197,9 @@ func_extract_changed_lines ()
        record_file();
        file = $2;
        start = NR - 1;
-       # some vcs use a/ and b/ as diff prefixes. strip them, and remember:
-       hasprefix = sub("^b/", "", file);
+       # some vcs use single-character dir names (often a/ and b/) as diff
+       # prefixes. strip them, and remember:
+       hasprefix = sub("^./", "", file);
        next;
       }
     }
-- 
1.5.5.40.g4cdda





reply via email to

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