Skip to content

Add a "summary" pretty format #340

@Denton-L

Description

@Denton-L

According to Documentation/SubmittingPatches,

[[commit-reference]]
If you want to reference a previous commit in the history of a stable
branch, use the format "abbreviated sha1 (subject, date)",
with the subject enclosed in a pair of double-quotes, like this:

....
	Commit f86a374 ("pack-bitmap.c: fix a memleak", 2015-03-30)
	noticed that ...
....

The "Copy commit summary" command of gitk can be used to obtain this
format, or this invocation of `git show`:

....
	git show -s --date=short --pretty='format:%h ("%s", %ad)' <commit>
....

But why must we manually enter this format? It seems commonplace enough that we should be able to specify something like git show -s --pretty=summary and it'll do the same thing.

One thing to consider: can we override the configured date settings? If a user doesn't provide a --date option, can we automatically assume --date=short?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions