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

Re: [GSoC Proposal/RFC] Rolling commit message writing

From
Avery Pennarun <apenwarr@gmail.com>
Date
Mar 29, 2010, 20:31 UTC
Message-ID
<32541b131003291331y3ae5ca23la33466d588c1b9e1@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.1003281834520.13534@pip.srcf.ucam.org>
On Sun, Mar 28, 2010 at 3:32 PM, Daniel Thomas <drt24@srcf.ucam.org> wrote:
Show 14 quoted lines
> Currently it is fairly easy to write good commit messages but the effort
> that this requires of developers can be reduced still further.
>
> This would be achieved by adding a built in system for working on a commit
> message during the stage of adding changes.
>
> Currently this can be done manually using "-F <file>, --file=<file>" in git
> commit but we can do better than that. Specifically changes to git add
> [--interactive | -i] to add an 'am' or similar command to allow adding a
> file and then prompting for a message about the changes to that file. Also
> changes to git add [--patch | -p] to add 'm' and 'c' options to git add
> --patch to allow the addition of a message for the current hunk ('m') and to
> do a commit (prompting for review) before returning to the hunk currently in
> focus ('c').

The extra prompting seems to me like it would slow down the process of 'git add -p' by making it take too many steps. Normally when I create a commit, I like to think of "which lines will I commit?" and "what is the description of the whole commit?" as separate questions, whereas this workflow would interweave the two and confuse me.

Do other people prefer it that way?

Secondly, I'm concerned that if you can't remember the description of your entire commit by the time you commit it, then your commit is too big. The usual solution is to create multiple, smaller commits that are easy to describe. If at the end you find yourself with too many commits, you can always join them together with git rebase.

You might also like 'git commit -v', which shows the actual diff to be committed as part of your default commit message. Then you can write your message while looking at it, making it easy to describe exactly what you changed.

Given these existing capabilities, is it still worth adding the feature you propose?

Have fun,
Avery
Previous: Daniel ThomasNext: Jonathan Nieder
Message 2 of 7 in “[GSoC Proposal/RFC] Rolling commit message writing”
  1. Daniel ThomasMar 28, 2010
  2. Avery PennarunMar 29, 2010
  3. Jonathan NiederMar 30, 2010
  4. Avery PennarunMar 30, 2010
  5. the careless committer and fear of commitment (rebase -i vs add -p)Jonathan Nieder, Mar 30, 2010
  6. Ramkumar RamachandraMar 30, 2010
  7. Jeff KingMar 30, 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.