Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fixes for option parsing
author
Linus Torvalds
<torvalds@osdl.org>
Sun, 16 Apr 2006 22:17:23 +0000
(15:17 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 16 Apr 2006 22:34:37 +0000
(15:34 -0700)
Make sure "git show" always show the header, regardless of whether there
is a diff or not.
Also, make sure "always_show_header" actually works, since generate_header
only tested it in one out of three return paths.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git.c
patch
|
blob
|
history
log-tree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cb8f64b
)
diff --git
a/git.c
b/git.c
index c5de8d3a1257a27fbe27fa7db76c90dc50944bbf..fc4e4292781d0aab39abaede2e872fce557a434b 100644
(file)
--- a/
git.c
+++ b/
git.c
@@
-373,6
+373,7
@@
static int cmd_show(int argc, const char **argv, char **envp)
rev.diffopt.recursive = 1;
rev.combine_merges = 1;
rev.dense_combined_merges = 1;
rev.diffopt.recursive = 1;
rev.combine_merges = 1;
rev.dense_combined_merges = 1;
+ rev.always_show_header = 1;
rev.ignore_merges = 0;
rev.no_walk = 1;
return cmd_log_wc(argc, argv, envp, &rev);
rev.ignore_merges = 0;
rev.no_walk = 1;
return cmd_log_wc(argc, argv, envp, &rev);
diff --git
a/log-tree.c
b/log-tree.c
index 7d9f41ede145f47fe8886770cdfb6e0bfb1abaea..af36f702e16daace6781a3b044c456062692aad4 100644
(file)
--- a/
log-tree.c
+++ b/
log-tree.c
@@
-43,7
+43,7
@@
static int diff_root_tree(struct rev_info *opt,
return retval;
}
return retval;
}
-static const char *ge
nerate
_header(struct rev_info *opt,
+static const char *ge
t
_header(struct rev_info *opt,
const unsigned char *commit_sha1,
const unsigned char *parent_sha1,
const struct commit *commit)
const unsigned char *commit_sha1,
const unsigned char *parent_sha1,
const struct commit *commit)
@@
-75,11
+75,21
@@
static const char *generate_header(struct rev_info *opt,
offset += pretty_print_commit(opt->commit_format, commit, len,
this_header + offset,
sizeof(this_header) - offset, abbrev);
offset += pretty_print_commit(opt->commit_format, commit, len,
this_header + offset,
sizeof(this_header) - offset, abbrev);
+ return this_header;
+}
+
+static const char *generate_header(struct rev_info *opt,
+ const unsigned char *commit_sha1,
+ const unsigned char *parent_sha1,
+ const struct commit *commit)
+{
+ const char *header = get_header(opt, commit_sha1, parent_sha1, commit);
+
if (opt->always_show_header) {
if (opt->always_show_header) {
- puts(
this_
header);
-
return
NULL;
+ puts(header);
+
header =
NULL;
}
}
- return
this_
header;
+ return header;
}
static int do_diff_combined(struct rev_info *opt, struct commit *commit)
}
static int do_diff_combined(struct rev_info *opt, struct commit *commit)