Skip to content

Commit

Permalink
fmt-patch: understand old <his> notation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed May 6, 2006
1 parent c66b6c0 commit e686eb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit e686eb9

Please sign in to comment.