From: Jonathan Nieder <jrnieder@gmail.com>
To: Tim Henigan <tim.henigan@gmail.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v1 06/25] contrib: remove 'diffall'
Date: Fri, 9 May 2014 13:12:46 -0700 [thread overview]
Message-ID: <20140509201246.GM9218@google.com> (raw)
In-Reply-To: <CAFouethK=VKYzTOW7dDi7tmOHaGtNp_xHxk3MSf+n1QNuXbEdQ@mail.gmail.com>
Hi,
Tim Henigan wrote:
> However, I like the idea of simply removing the directory from contrib
> and pointing to 'difftool --dir-diff' in the release notes.
Thanks. I believe Junio uses commit messages as reference when
writing release notes so hopefully this should be enough to make that
happen.
-- >8 --
Subject: contrib: remove git-diffall
The functionality of the "git diffall" script in contrib/ was
incorporated into "git difftool" when the --dir-diff option was added
in v1.7.11 (ca. June, 2012). Once difftool learned those features,
the diffall script became obsolete.
The only difference in behavior is that when comparing to the working
tree, difftool copies any files modified by the user back to the
working tree when the diff tool exits. "git diffall" required the
--copy-back option to do the same. All other diffall options have the
same meaning in difftool.
Make life easier for people choosing a tool to use by removing the old
diffall script. A pointer in the release notes should be enough to
help current users migrate.
Helped-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
contrib/diffall/README | 31 ------
contrib/diffall/git-diffall | 257 --------------------------------------------
2 files changed, 288 deletions(-)
delete mode 100644 contrib/diffall/README
delete mode 100755 contrib/diffall/git-diffall
diff --git a/contrib/diffall/README b/contrib/diffall/README
deleted file mode 100644
index 507f17d..0000000
--- a/contrib/diffall/README
+++ /dev/null
@@ -1,31 +0,0 @@
-The git-diffall script provides a directory based diff mechanism
-for git.
-
-To determine what diff viewer is used, the script requires either
-the 'diff.tool' or 'merge.tool' configuration option to be set.
-
-This script is compatible with most common forms used to specify a
-range of revisions to diff:
-
- 1. git diffall: shows diff between working tree and staged changes
- 2. git diffall --cached [<commit>]: shows diff between staged
- changes and HEAD (or other named commit)
- 3. git diffall <commit>: shows diff between working tree and named
- commit
- 4. git diffall <commit> <commit>: show diff between two named commits
- 5. git diffall <commit>..<commit>: same as above
- 6. git diffall <commit>...<commit>: show the changes on the branch
- containing and up to the second, starting at a common ancestor
- of both <commit>
-
-Note: all forms take an optional path limiter [-- <path>*]
-
-The '--extcmd=<command>' option allows the user to specify a custom
-command for viewing diffs. When given, configured defaults are
-ignored and the script runs $command $LOCAL $REMOTE. Additionally,
-$BASE is set in the environment.
-
-This script is based on an example provided by Thomas Rast on the
-Git list [1]:
-
-[1] http://thread.gmane.org/gmane.comp.version-control.git/124807
diff --git a/contrib/diffall/git-diffall b/contrib/diffall/git-diffall
deleted file mode 100755
index 84f2b65..0000000
--- a/contrib/diffall/git-diffall
+++ /dev/null
@@ -1,257 +0,0 @@
-#!/bin/sh
-# Copyright 2010 - 2012, Tim Henigan <tim.henigan@gmail.com>
-#
-# Perform a directory diff between commits in the repository using
-# the external diff or merge tool specified in the user's config.
-
-USAGE='[--cached] [--copy-back] [-x|--extcmd=<command>] <commit>{0,2} [-- <path>*]
-
- --cached Compare to the index rather than the working tree.
-
- --copy-back Copy files back to the working tree when the diff
- tool exits (in case they were modified by the
- user). This option is only valid if the diff
- compared with the working tree.
-
- -x=<command>
- --extcmd=<command> Specify a custom command for viewing diffs.
- git-diffall ignores the configured defaults and
- runs $command $LOCAL $REMOTE when this option is
- specified. Additionally, $BASE is set in the
- environment.
-'
-
-SUBDIRECTORY_OK=1
-. "$(git --exec-path)/git-sh-setup"
-
-TOOL_MODE=diff
-. "$(git --exec-path)/git-mergetool--lib"
-
-merge_tool="$(get_merge_tool)"
-if test -z "$merge_tool"
-then
- echo "Error: Either the 'diff.tool' or 'merge.tool' option must be set."
- usage
-fi
-
-start_dir=$(pwd)
-
-# All the file paths returned by the diff command are relative to the root
-# of the working copy. So if the script is called from a subdirectory, it
-# must switch to the root of working copy before trying to use those paths.
-cdup=$(git rev-parse --show-cdup) &&
-cd "$cdup" || {
- echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree"
- exit 1
-}
-
-# set up temp dir
-tmp=$(perl -e 'use File::Temp qw(tempdir);
- $t=tempdir("/tmp/git-diffall.XXXXX") or exit(1);
- print $t') || exit 1
-trap 'rm -rf "$tmp"' EXIT
-
-left=
-right=
-paths=
-dashdash_seen=
-compare_staged=
-merge_base=
-left_dir=
-right_dir=
-diff_tool=
-copy_back=
-
-while test $# != 0
-do
- case "$1" in
- -h|--h|--he|--hel|--help)
- usage
- ;;
- --cached)
- compare_staged=1
- ;;
- --copy-back)
- copy_back=1
- ;;
- -x|--e|--ex|--ext|--extc|--extcm|--extcmd)
- if test $# = 1
- then
- echo You must specify the tool for use with --extcmd
- usage
- else
- diff_tool=$2
- shift
- fi
- ;;
- --)
- dashdash_seen=1
- ;;
- -*)
- echo Invalid option: "$1"
- usage
- ;;
- *)
- # could be commit, commit range or path limiter
- case "$1" in
- *...*)
- left=${1%...*}
- right=${1#*...}
- merge_base=1
- ;;
- *..*)
- left=${1%..*}
- right=${1#*..}
- ;;
- *)
- if test -n "$dashdash_seen"
- then
- paths="$paths$1 "
- elif test -z "$left"
- then
- left=$1
- elif test -z "$right"
- then
- right=$1
- else
- paths="$paths$1 "
- fi
- ;;
- esac
- ;;
- esac
- shift
-done
-
-# Determine the set of files which changed
-if test -n "$left" && test -n "$right"
-then
- left_dir="cmt-$(git rev-parse --short $left)"
- right_dir="cmt-$(git rev-parse --short $right)"
-
- if test -n "$compare_staged"
- then
- usage
- elif test -n "$merge_base"
- then
- git diff --name-only "$left"..."$right" -- $paths >"$tmp/filelist"
- else
- git diff --name-only "$left" "$right" -- $paths >"$tmp/filelist"
- fi
-elif test -n "$left"
-then
- left_dir="cmt-$(git rev-parse --short $left)"
-
- if test -n "$compare_staged"
- then
- right_dir="staged"
- git diff --name-only --cached "$left" -- $paths >"$tmp/filelist"
- else
- right_dir="working_tree"
- git diff --name-only "$left" -- $paths >"$tmp/filelist"
- fi
-else
- left_dir="HEAD"
-
- if test -n "$compare_staged"
- then
- right_dir="staged"
- git diff --name-only --cached -- $paths >"$tmp/filelist"
- else
- right_dir="working_tree"
- git diff --name-only -- $paths >"$tmp/filelist"
- fi
-fi
-
-# Exit immediately if there are no diffs
-if test ! -s "$tmp/filelist"
-then
- exit 0
-fi
-
-if test -n "$copy_back" && test "$right_dir" != "working_tree"
-then
- echo "--copy-back is only valid when diff includes the working tree."
- exit 1
-fi
-
-# Create the named tmp directories that will hold the files to be compared
-mkdir -p "$tmp/$left_dir" "$tmp/$right_dir"
-
-# Populate the tmp/right_dir directory with the files to be compared
-while read name
-do
- if test -n "$right"
- then
- ls_list=$(git ls-tree $right "$name")
- if test -n "$ls_list"
- then
- mkdir -p "$tmp/$right_dir/$(dirname "$name")"
- git show "$right":"$name" >"$tmp/$right_dir/$name" || true
- fi
- elif test -n "$compare_staged"
- then
- ls_list=$(git ls-files -- "$name")
- if test -n "$ls_list"
- then
- mkdir -p "$tmp/$right_dir/$(dirname "$name")"
- git show :"$name" >"$tmp/$right_dir/$name"
- fi
- else
- if test -e "$name"
- then
- mkdir -p "$tmp/$right_dir/$(dirname "$name")"
- cp "$name" "$tmp/$right_dir/$name"
- fi
- fi
-done < "$tmp/filelist"
-
-# Populate the tmp/left_dir directory with the files to be compared
-while read name
-do
- if test -n "$left"
- then
- ls_list=$(git ls-tree $left "$name")
- if test -n "$ls_list"
- then
- mkdir -p "$tmp/$left_dir/$(dirname "$name")"
- git show "$left":"$name" >"$tmp/$left_dir/$name" || true
- fi
- else
- if test -n "$compare_staged"
- then
- ls_list=$(git ls-tree HEAD "$name")
- if test -n "$ls_list"
- then
- mkdir -p "$tmp/$left_dir/$(dirname "$name")"
- git show HEAD:"$name" >"$tmp/$left_dir/$name"
- fi
- else
- mkdir -p "$tmp/$left_dir/$(dirname "$name")"
- git show :"$name" >"$tmp/$left_dir/$name"
- fi
- fi
-done < "$tmp/filelist"
-
-LOCAL="$tmp/$left_dir"
-REMOTE="$tmp/$right_dir"
-
-if test -n "$diff_tool"
-then
- export BASE
- eval $diff_tool '"$LOCAL"' '"$REMOTE"'
-else
- run_merge_tool "$merge_tool" false
-fi
-
-# Copy files back to the working dir, if requested
-if test -n "$copy_back" && test "$right_dir" = "working_tree"
-then
- cd "$start_dir"
- git_top_dir=$(git rev-parse --show-toplevel)
- find "$tmp/$right_dir" -type f |
- while read file
- do
- cp "$file" "$git_top_dir/${file#$tmp/$right_dir/}"
- done
-fi
--
1.9.1.423.g4596e3a
next prev parent reply other threads:[~2014-05-09 20:12 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 0:58 [PATCH v1 00/25] contrib: cleanup Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 02/25] contrib: remove 'hg-to-git' Felipe Contreras
2014-05-09 6:44 ` Miklos Vajna
2014-05-09 0:58 ` [PATCH v1 03/25] contrib: remove 'stats' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 04/25] contrib: remove 'buildsystems' Felipe Contreras
2014-05-09 7:53 ` Erik Faye-Lund
2014-05-09 8:14 ` Felipe Contreras
2014-05-09 8:33 ` Erik Faye-Lund
2014-05-09 8:48 ` Felipe Contreras
2014-05-09 9:10 ` Erik Faye-Lund
2014-05-09 9:32 ` Felipe Contreras
2014-05-09 10:02 ` Erik Faye-Lund
2014-05-09 10:57 ` Felipe Contreras
2014-05-09 11:35 ` Erik Faye-Lund
2014-05-09 9:17 ` David Kastrup
2014-05-09 9:35 ` Felipe Contreras
2014-05-09 9:44 ` David Kastrup
2014-05-09 10:50 ` Felipe Contreras
2014-05-09 11:21 ` David Kastrup
2014-05-09 18:33 ` Jonathan Nieder
2014-05-09 0:58 ` [PATCH v1 05/25] contrib: remove 'convert-objects' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 06/25] contrib: remove 'diffall' Felipe Contreras
2014-05-09 15:12 ` Tim Henigan
2014-05-09 18:50 ` Jonathan Nieder
2014-05-09 19:26 ` Tim Henigan
2014-05-09 20:12 ` Jonathan Nieder [this message]
2014-05-09 20:16 ` Tim Henigan
[not found] ` <CAFouetj=30Wd_CDiXA0UqqKNdfJSv+C5mWbMJPOkEdqxr7k54w@mail.gmail.com>
2014-05-09 15:20 ` Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 07/25] contrib: remove 'git-jump' Felipe Contreras
2014-05-09 2:03 ` Jeff King
2014-05-09 2:12 ` Felipe Contreras
2014-05-09 15:20 ` Jeff King
2014-05-09 16:13 ` Felipe Contreras
2014-05-09 17:37 ` Junio C Hamano
2014-05-09 0:58 ` [PATCH v1 08/25] contrib: remove 'git-shell-commands' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 09/25] contrib: remove 'gitview' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 10/25] contrib: reomve 'thunderbird-patch-inline' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 11/25] contrib: remove 'workdir' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 12/25] contrib: remove 'vim' Felipe Contreras
2014-05-09 2:02 ` Jeff King
2014-05-09 2:23 ` Jonathan Nieder
2014-05-09 0:58 ` [PATCH v1 13/25] contrib: remove 'svn-fe' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 14/25] contrib: remove 'rerere-train' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 15/25] contrib: remove 'remotes2config' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 16/25] contrib: remove 'persistent-https' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 17/25] contrib: remove 'git-resurrect' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 18/25] contrib: remove 'emacs' Felipe Contreras
[not found] ` <CAFcZeCqbF54-KjHU1R3pC6XgWi21KcpRGB7HcbfSGyvTScQU2A@mail.gmail.com>
2014-05-09 8:29 ` Felipe Contreras
[not found] ` <CAFcZeCo5mCfnUN1uBiaZnD6DL6y8hPhK5MPts5raLCTGwJX9Gg@mail.gmail.com>
2014-05-09 8:50 ` Felipe Contreras
2014-05-09 14:50 ` Alexandre Julliard
2014-05-09 14:53 ` Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 19/25] contrib: remove 'diff-highlight' Felipe Contreras
2014-05-09 1:51 ` Jeff King
2014-05-09 1:55 ` Felipe Contreras
2014-05-09 13:37 ` Stefan Beller
2014-05-09 14:16 ` Felipe Contreras
2014-05-09 17:04 ` Junio C Hamano
2014-05-09 17:45 ` Felipe Contreras
2014-05-09 18:06 ` Junio C Hamano
2014-05-09 18:21 ` Felipe Contreras
2014-05-09 18:29 ` Junio C Hamano
2014-05-09 18:40 ` Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 20/25] contrib: remove 'contacts' Felipe Contreras
2014-05-10 1:59 ` brian m. carlson
2014-05-10 4:00 ` Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 22/25] contrib: remove 'fast-import' Felipe Contreras
2014-05-09 0:58 ` [PATCH v1 24/25] contrib: remove 'hooks' Felipe Contreras
2014-05-09 1:47 ` [PATCH v1 00/25] contrib: cleanup Martin Langhoff
[not found] ` <CACPiFCJnsu3qw59oK94sP1u0+KBDvne0ZpKS0LMGc_9ge+rJjA@mail.gmail.com>
2014-05-09 2:01 ` Felipe Contreras
2014-05-09 13:15 ` Stefan Beller
2014-05-09 15:22 ` Jeff King
2014-05-09 15:57 ` Felipe Contreras
2014-05-09 17:09 ` Martin Langhoff
2014-05-09 17:15 ` Felipe Contreras
[not found] ` <1399597116-1851-26-git-send-email-felipe.contreras@gmail.com>
2014-05-09 10:46 ` [PATCH v1 25/25] contrib: remove 'mw-to-git' Matthieu Moy
2014-05-09 10:59 ` Felipe Contreras
2014-05-09 12:30 ` Stefan Beller
[not found] ` <1399597116-1851-24-git-send-email-felipe.contreras@gmail.com>
2014-05-09 15:00 ` [PATCH v1 23/25] contrib: remove 'hooks/multimail' Michael Haggerty
2014-05-09 15:04 ` David Kastrup
2014-05-09 15:28 ` Michael Haggerty
2014-05-09 15:18 ` Felipe Contreras
2014-05-09 16:46 ` James Denholm
2014-05-09 19:56 ` [PATCH v1 00/25] contrib: cleanup Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140509201246.GM9218@google.com \
--to=jrnieder@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tim.henigan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).