@matheusbsbs / matheus-bagliano / commits / e686eb9870
Fork 0

fmt-patch: understand old <his> notation

When calling "git fmt-patch HEAD~5", you now get the same as if you would have said "git fmt-patch HEAD~5..". This makes it easier for my fingers which are so used to the old syntax. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed May 6, 2006 at 22:56 UTC e686eb9870d6b382f0760e3e859e93c8c2dfb31b
2 files changed +9 -1
builtin-diff.c
+1 -1
@@ -232,7 +232,7 @@ static int builtin_diff_combined(struct rev_info *revs,
232 return 0;
233 }
234
235 -static void add_head(struct rev_info *revs)
235 +void add_head(struct rev_info *revs)
236 {
237 unsigned char sha1[20];
238 struct object *obj;
builtin-log.c
+8
@@ -11,6 +11,9 @@
11 #include "log-tree.h"
12 #include "builtin.h"
13
14 +/* this is in builtin-diff.c */
15 +void add_head(struct rev_info *revs);
16 +
17 static int cmd_log_wc(int argc, const char **argv, char **envp,
18 struct rev_info *rev)
19 {
@@ -185,6 +188,11 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
188 if (argc > 1)
189 die ("unrecognized argument: %s", argv[1]);
190
191 + if (rev.pending_objects && rev.pending_objects->next == NULL) {
192 + rev.pending_objects->item->flags |= UNINTERESTING;
193 + add_head(&rev);
194 + }
195 +
196 if (!use_stdout)
197 realstdout = fdopen(dup(1), "w");
198