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

Re: changing log entries

From
Shawn Pearce <spearce@spearce.org>
Date
Dec 13, 2006, 23:24 UTC
Message-ID
<20061213232452.GE32568@spearce.org>
In-Reply-To
<1166051281.1808.1.camel@jcm.boston.redhat.com>
Jon Masters <jcm@redhat.com> wrote:
Show 8 quoted lines
> Hi,
> 
> So I figured out that the problem with "Can't lock ref" was down to not
> having set one of the scripts executable on the http server. Great.
> 
> Anyway, now I would like to change an existing log entry to make it a
> bit cleaner (read: add a first line that's under 80 characters). What's
> the best way to change an existing log entry for a commit?
If its the most recent commit on that branch, "git commit --amend".

Otherwise dump out the branch to patches with git format-patch, amend the commit in question, then replay the patches with git am.

Or use StGIT to uncommit the changes, pop them off, fix the commit, then repush the patches and recommit in StGIT.

Note that any of the above methods change the SHA1 of that commit and every commit which follows it on that branch. Consequently it is generally considered to be impolite to edit commits without warning which you have already published, as another person may be basing their own work off that commit.

Previous: Jakub NarebskiNext: Andy Parkins
Message 3 of 5 in “changing log entries”
  1. Jon MastersDec 13, 2006
  2. Jakub NarebskiDec 13, 2006
  3. Shawn PearceDec 13, 2006
  4. Andy ParkinsDec 14, 2006
  5. Jakub NarebskiDec 15, 2006

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.