diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-17 10:28:17 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-17 10:28:18 -0700 |
| commit | fe7ae3b87ef866e4818a106e8ce6e3d821ed76d7 (patch) | |
| tree | 62b9e3f9ef561e61f39593f245a49c4f0a727f59 /builtin | |
| parent | b45113f5818b26bf22b85988f9ef7ff2da06d4a1 (diff) | |
| parent | 4d253071ddd44ee5fad88702431603d43215b3af (diff) | |
| download | git-fe7ae3b87ef866e4818a106e8ce6e3d821ed76d7.tar.gz | |
Merge branch 'kn/blame-porcelain-unblamable'
"git blame --porcelain" mode now talks about unblamable lines and
lines that are blamed to an ignored commit.
* kn/blame-porcelain-unblamable:
blame: print unblamable and ignored commits in porcelain mode
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/blame.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index c470654c7e..9436f70aec 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -351,6 +351,19 @@ static void emit_porcelain_details(struct blame_origin *suspect, int repeat) write_filename_info(suspect); } +/* + * Information which needs to be printed per-line goes here. Any + * information which can be clubbed on a commit/file level, should + * be printed via 'emit_one_suspect_detail()'. + */ +static void emit_porcelain_per_line_details(struct blame_entry *ent) +{ + if (mark_unblamable_lines && ent->unblamable) + puts("unblamable"); + if (mark_ignored_lines && ent->ignored) + puts("ignored"); +} + static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent, int opt) { @@ -367,6 +380,7 @@ static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent, ent->lno + 1, ent->num_lines); emit_porcelain_details(suspect, repeat); + emit_porcelain_per_line_details(ent); cp = blame_nth_line(sb, ent->lno); for (cnt = 0; cnt < ent->num_lines; cnt++) { @@ -377,6 +391,7 @@ static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent, ent->lno + 1 + cnt); if (repeat) emit_porcelain_details(suspect, 1); + emit_porcelain_per_line_details(ent); } putchar('\t'); do { |
