mirror of
https://github.com/git/git.git
synced 2024-11-17 22:44:49 +01:00
Merge branch 'lt/logopt' into next
* lt/logopt: Fixes for option parsing
This commit is contained in:
commit
6adfbe9b27
2 changed files with 16 additions and 5 deletions
1
git.c
1
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.always_show_header = 1;
|
||||
rev.ignore_merges = 0;
|
||||
rev.no_walk = 1;
|
||||
return cmd_log_wc(argc, argv, envp, &rev);
|
||||
|
|
20
log-tree.c
20
log-tree.c
|
@ -43,7 +43,7 @@ static int diff_root_tree(struct rev_info *opt,
|
|||
return retval;
|
||||
}
|
||||
|
||||
static const char *generate_header(struct rev_info *opt,
|
||||
static const char *get_header(struct rev_info *opt,
|
||||
const unsigned char *commit_sha1,
|
||||
const unsigned char *parent_sha1,
|
||||
const struct commit *commit)
|
||||
|
@ -75,13 +75,23 @@ 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);
|
||||
if (opt->always_show_header) {
|
||||
puts(this_header);
|
||||
return NULL;
|
||||
}
|
||||
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) {
|
||||
puts(header);
|
||||
header = NULL;
|
||||
}
|
||||
return header;
|
||||
}
|
||||
|
||||
static int do_diff_combined(struct rev_info *opt, struct commit *commit)
|
||||
{
|
||||
unsigned const char *sha1 = commit->object.sha1;
|
||||
|
|
Loading…
Reference in a new issue