From: Gwyneth Morgan <gwymor@tilde.club>
To: git@vger.kernel.org
Subject: git-range-diff ignoring commit message changes
Date: Mon, 15 Jan 2024 19:40:36 +0000 [thread overview]
Message-ID: <ZaWKNI5qLPf4P75A@tilde.club> (raw)
Is there a way to make git-range-diff to ignore commit messages when
considering if commits are identical? When range-diffing long series
there are cases where I would like to check at a glance whether the code
has changed, and only when the code has changed do I want to see the
change in commit message too.
It seems I can approximate what I want by tweaking range-diff's source
like this but I couldn't tell if there was an actual option:
diff --git a/range-diff.c b/range-diff.c
index c45b6d849c..fd421b7b99 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -59,7 +59,7 @@ static int read_patches(const char *range, struct string_list *list,
"--output-indicator-old=<",
"--output-indicator-context=#",
"--no-abbrev-commit",
- "--pretty=medium",
+ "--pretty=format:commit %H",
"--show-notes-by-default",
NULL);
strvec_push(&cp.args, range);
This ignores commit message changes entirely, but it would be nice to
have an option to only see commit message changes when the code diff has
changed. It would also be convenient to have a way to only consider
changes in the title of commits but ignore the message body (equivalent
to "--pretty=short" above).
You could get some of this information with git-cherry, but that is
suited for different uses (only cares about new commits on one side,
doesn't show diffs) and would take more effort than just ignoring the
commit messages in the current range-diff output.
reply other threads:[~2024-01-15 19:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZaWKNI5qLPf4P75A@tilde.club \
--to=gwymor@tilde.club \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).