git-history-editor icon indicating copy to clipboard operation
git-history-editor copied to clipboard

feature request : batch edit

Open avilleret opened this issue 5 years ago • 4 comments

It would be very nice to be able to easily edit several commits at once.

For example, changing the author name or email of several commits, or adding an offset to commit dates. Also it would be convenient to use keyboard to edit timestamp (to type number into boxes).

I would like to contribute to this great but I have no idea how to implement such a feature 🙄 for now... 😄

avilleret avatar Jul 02 '20 18:07 avilleret

You can already replace a name or an email with another one in ALL commits, using the "Bulk Edit" mode. Is it what you have in mind ?

bokub avatar Jul 03 '20 07:07 bokub

oups yes for author name/email bulk edit mode does the trick

but then I'm missing the date offset, for me, we could have a check box next to each commit line to select it and choose which value to change, and for date it could work as relative or absolute (I worked on sunday but want to move all sunday's commit on next monday morning)

avilleret avatar Jul 03 '20 12:07 avilleret

Oh, I get it now, you'd like to edit multiple commits at once using check-boxes

I'll think about that

bokub avatar Jul 03 '20 13:07 bokub

I'd love to have a bulk-edit functionality that's driven by a regular expression, or a simple "find/replace" type behavior (so I could edit every commit msg and replace bits of information with new information).

The use case I'm primarily targeting is editing Jira ticket IDs within a batch of commits. We use a pre-commit script to append a ticket ID to the beginning of every commit (based on a pattern in the branch name), and occasionally I have to move commits around between branches & different tickets, and need a way to essentially find/replace something like "XX-1234" with "XX-5678".

Interactive rebase + the --exec flag gets me pretty close, but it's still not an automatic/one-click action.

erawhctim avatar Sep 30 '22 12:09 erawhctim