git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: I want to omit the commit log message from the log output

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 27, 2010, 19:36 UTC
Message-ID
<20101027193650.GA24934@burratino>
In-Reply-To
<18995.1288205882@relay.known.net>
Hi,
layer wrote:
> I'm trying to simulate the output that comes at the end of the merge:
Cheating answer:
Hmm, I wonder how the scripted version did that.
$ git grep -Oless -eFast-forward -- contrib/examples/git-merge.sh
        msg="Fast-forward"
        if test -n "$have_message"
        then
                msg="$msg (no commit created; -m option ignored)"
        fi
        new_head=$(git rev-parse --verify "$1^0") &&
        git read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
        finish "$new_head" "$msg" || exit
        dropsave
        exit 0
        ;;
[ok, it's the finish function.  press q to exit the pager, and]
$ git grep -Oless -F -e'finish ()' -- contrib/examples/git-merge.sh
finish () {
        if test '' = "$2"
[...]
                if test "$show_diffstat" = t
                then
                        # We want color (if set), but no pager
                        GIT_PAGER='' git diff --stat --summary -M "$head" "$1"
[...]
So apparently
	git diff --stat --summary -M <before> <after>
will take care of it.

On the other hand, if you want diff output for a single commit (i.e., "somewhat like git rev-list --pretty --summary --stat --no-walk but no commit messages"), then some variation on

	git diff-tree --color --cc --summary --stat --no-commit-id origin/pu
might bring some joy.

Hope that helps, Jonathan

Previous: layerNext: layer
Message 2 of 3 in “I want to omit the commit log message from the log output”
  1. layerOct 27, 2010
  2. Jonathan NiederOct 27, 2010
  3. layerOct 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.