aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-04-06 01:31:20 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-07 22:19:55 -0700
commit2e8af7e42b15d4f2d573329ea2593a19f45f18d3 (patch)
treeeae43cc93b54d63ee8de072447997bbfe4b8c2bc /contrib
parent76ca653842057766773776bffc6a415b39d5a147 (diff)
downloadgit-2e8af7e42b15d4f2d573329ea2593a19f45f18d3.tar.gz
git-2e8af7e42b15d4f2d573329ea2593a19f45f18d3.tar.xz
difftool: remove the backup file feature
Most users find the backup file feature annoying and there's no need for it since diff is supposed to be a read-only operation. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/difftool/git-difftool-helper34
1 files changed, 1 insertions, 33 deletions
diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
index ef684b6f6..e74a2747b 100755
--- a/contrib/difftool/git-difftool-helper
+++ b/contrib/difftool/git-difftool-helper
@@ -9,31 +9,7 @@
# Set GIT_DIFFTOOL_NO_PROMPT to bypass the per-file prompt.
should_prompt () {
- ! test -n "$GIT_DIFFTOOL_NO_PROMPT"
-}
-
-# Should we keep the backup .orig file?
-keep_backup_mode="$(git config --bool merge.keepBackup || echo true)"
-keep_backup () {
- test "$keep_backup_mode" = "true"
-}
-
-# This function manages the backup .orig file.
-# A backup $MERGED.orig file is created if changes are detected.
-cleanup_temp_files () {
- if test -n "$MERGED"; then
- if keep_backup && test "$MERGED" -nt "$BACKUP"; then
- test -f "$BACKUP" && mv -- "$BACKUP" "$MERGED.orig"
- else
- rm -f -- "$BACKUP"
- fi
- fi
-}
-
-# This is called when users Ctrl-C out of git-difftool-helper
-sigint_handler () {
- cleanup_temp_files
- exit 1
+ test -z "$GIT_DIFFTOOL_NO_PROMPT"
}
# This function prepares temporary files and launches the appropriate
@@ -47,12 +23,6 @@ launch_merge_tool () {
LOCAL="$2"
REMOTE="$3"
BASE="$1"
- ext="$$$(expr "$MERGED" : '.*\(\.[^/]*\)$')"
- BACKUP="$MERGED.BACKUP.$ext"
-
- # Create and ensure that we clean up $BACKUP
- test -f "$MERGED" && cp -- "$MERGED" "$BACKUP"
- trap sigint_handler INT
# $LOCAL and $REMOTE are temporary files so prompt
# the user with the real $MERGED name before launching $merge_tool.
@@ -120,8 +90,6 @@ launch_merge_tool () {
fi
;;
esac
-
- cleanup_temp_files
}
# Verifies that (difftool|mergetool).<tool>.cmd exists