aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-11-08 21:37:09 +1100
committerPaul Mackerras <paulus@samba.org>2008-11-08 21:37:09 +1100
commit887a791f113a09a56bb4916243463481a51d86a4 (patch)
treeec686d8c69e879c8eec1b45b8ef43f1ad8e885dd
parent15e350552db1c0e8ede0af4f1f07dbbc9090e420 (diff)
downloadgit-887a791f113a09a56bb4916243463481a51d86a4.tar.gz
git-887a791f113a09a56bb4916243463481a51d86a4.tar.xz
gitk: Improve cherry-pick error handling
This adds to the regexps that are used to work out what sort of error we encountered in trying to do a cherry-pick so that it recognizes some additional common error messages. It adds a confirmation dialog when the error is a merge conflict so the user can choose whether or not to run git citool. Finally, it arranges to update the display after a cherry-pick failed so that any local changes made by the cherry-pick become visible. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk25
1 files changed, 16 insertions, 9 deletions
diff --git a/gitk b/gitk
index 4168648b5..58ad47d18 100755
--- a/gitk
+++ b/gitk
@@ -8133,18 +8133,25 @@ proc cherrypick {} {
if {[catch {exec sh -c "git cherry-pick -r $rowmenuid 2>&1"} err]} {
notbusy cherrypick
if {[regexp -line \
- {Entry '(.*)' would be overwritten by merge} $err msg fname]} {
- error_popup [mc "Cherry-pick failed:
-file '%s' had local modifications.
-
-Please commit, reset or stash your changes." $fname]
- } elseif {[regexp -line {^CONFLICT \(.*\):} $err msg]} {
- # Force citool to read MERGE_MSG
- file delete [file join [gitdir] "GITGUI_MSG"]
- exec_citool {} $rowmenuid
+ {Entry '(.*)' (would be overwritten by merge|not uptodate)} \
+ $err msg fname]} {
+ error_popup [mc "Cherry-pick failed because of local changes\
+ to file '%s'.\nPlease commit, reset or stash\
+ your changes and try again." $fname]
+ } elseif {[regexp -line \
+ {^(CONFLICT \(.*\):|Automatic cherry-pick failed)} \
+ $err]} {
+ if {[confirm_popup [mc "Cherry-pick failed because of merge\
+ conflict.\nDo you wish to run git citool to\
+ resolve it?"]]} {
+ # Force citool to read MERGE_MSG
+ file delete [file join [gitdir] "GITGUI_MSG"]
+ exec_citool {} $rowmenuid
+ }
} else {
error_popup $err
}
+ run updatecommits
return
}
set newhead [exec git rev-parse HEAD]