Hi, this is a proof of concept patch that allows editing of commits from gitk. I often review patches before pushing in gitk and if I would like to have an easy way of fixing typos in commit messages etc. So the patch adds "Edit this commit" item to gitk's context menu and the actual editing is done by non-interactively invoking interactive rebase :-) and git gui. There is almost no error checking etc., but before learning TCL and coding this properly, I'd like to get some feedback. -Michal Signed-off-by: Michal Sojka <sojka@xxxxxxxxxxxxxxxxxxxx> --- gitk-git/gitk | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index 4cde0c4..121b926 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -2497,6 +2497,7 @@ proc makewindow {} { {mc "Return to mark" command gotomark} {mc "Find descendant of this and mark" command find_common_desc} {mc "Compare with marked commit" command compare_commits} + {mc "Edit this commit" command edit_commit} } $rowctxmenu configure -tearoff 0 @@ -9102,6 +9103,21 @@ proc cherrypick {} { notbusy cherrypick } +proc edit_commit {} { + global rowmenuid + + nowbusy edit [mc "Editing commit"] + if {[catch {exec sh -c "(GIT_EDITOR='sed -ie 1s/^pick/edit/' git rebase -i $rowmenuid^ && git gui citool --amend && git rebase --continue) 2>&1"} err]} { + notbusy edit + error_popup $err + exec git rebase --abort + return + } + notbusy edit + run updatecommits +} + + proc resethead {} { global mainhead rowmenuid confirm_ok resettype NS -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html