提交 e686eb98 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

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: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c66b6c06
......@@ -232,7 +232,7 @@ static int builtin_diff_combined(struct rev_info *revs,
return 0;
}
static void add_head(struct rev_info *revs)
void add_head(struct rev_info *revs)
{
unsigned char sha1[20];
struct object *obj;
......
......@@ -11,6 +11,9 @@
#include "log-tree.h"
#include "builtin.h"
/* this is in builtin-diff.c */
void add_head(struct rev_info *revs);
static int cmd_log_wc(int argc, const char **argv, char **envp,
struct rev_info *rev)
{
......@@ -185,6 +188,11 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);
if (rev.pending_objects && rev.pending_objects->next == NULL) {
rev.pending_objects->item->flags |= UNINTERESTING;
add_head(&rev);
}
if (!use_stdout)
realstdout = fdopen(dup(1), "w");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册