Skip to contentSkip to conversation

Editing Git Log

DISCUSSION Piet Delaney 4 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I think I recall reading that a feature of git was the prevention of the git commits from being changed. I noticed today that a couple of us have checked in files without our customary [XTENSA] architecture prefixed to the 1st line of our Commit Messages.

I couldn't find a way to do this, other than our reverting back to a earlier repository and recommitting (each?) change with the slightly changed Commit Message; not an attractive investment of our time.

Any suggestions?

-piet

#1 lore raw
Quoted 7 lines · Piet Delaney

I think I recall reading that a feature of git was the prevention of the git commits
from being changed. I noticed today that a couple of us have checked in files
without our customary [XTENSA] architecture prefixed to the 1st line of our Commit Messages.

Quoted 7 lines

I couldn't find a way to do this, other than our reverting back to a earlier repository
and recommitting (each?) change with the slightly changed Commit Message; not an attractive investment of our time.

Any suggestions?

You have to create new commits, but you do not have to do it by hand. See filter-branch[1]

The example given in the manpage removes the git-svn identifiers:

git filter-branch --msg-filter '

        sed -e "/^git-svn-id:/d"

'

You can probably modify the sed expression and use it nearly as is (of course you would not want to filter the whole history, only the handful commits that came from you or your team.

[1]: http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html

#2 lore raw
In reply to Piet Delaney
Quoted 12 lines · Piet Delaney

I think I recall reading that a feature of git was the prevention of the git commits
from being changed. I noticed today that a couple of us have checked in files
without our customary [XTENSA] architecture prefixed to the 1st line of our Commit Messages.

I couldn't find a way to do this, other than our reverting back to a earlier repository
and recommitting (each?) change with the slightly changed Commit Message; not an attractive investment of our time.

Quoted 4 lines

Any suggestions?

-piet
--

git rebase --interactive FIRST_BAD_COMMIT^ will effectively do the same as above but in a nice automated way. Just change pick => edit on these patches that need fixing, you'll see.

Boaz

#3 lore raw
Quoted 13 lines · Boaz Harrosh
Quoted 12 lines · Piet Delaney

I think I recall reading that a feature of git was the prevention of the git commits
from being changed. I noticed today that a couple of us have checked in files
without our customary [XTENSA] architecture prefixed to the 1st line of our Commit Messages.

I couldn't find a way to do this, other than our reverting back to a earlier repository
and recommitting (each?) change with the slightly changed Commit Message; not an attractive investment of our time.

Quoted 8 lines
Quoted 4 lines

Any suggestions?

-piet
--

git rebase --interactive FIRST_BAD_COMMIT^ will effectively do the same as above but in a nice automated way. Just change pick => edit on these patches that need fixing, you'll see.

git filter-branch with a suited msg-filter is even more automated :-)

Björn