git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v1 06/25] contrib: remove 'diffall'

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 9, 2014, 20:12 UTC
Message-ID
<20140509201246.GM9218@google.com>
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
Previous: Tim HeniganNext: Tim Henigan
Message 26 of 83 in “contrib: cleanup”
  1. 00/25 contrib: cleanupFelipe Contreras, May 9, 2014
  2. 02/25 contrib: remove 'hg-to-git'Felipe Contreras, May 9, 2014
  3. Miklos VajnaMay 9, 2014
  4. 03/25 contrib: remove 'stats'Felipe Contreras, May 9, 2014
  5. 04/25 contrib: remove 'buildsystems'Felipe Contreras, May 9, 2014
  6. Erik Faye-LundMay 9, 2014
  7. Felipe ContrerasMay 9, 2014
  8. Erik Faye-LundMay 9, 2014
  9. Felipe ContrerasMay 9, 2014
  10. Erik Faye-LundMay 9, 2014
  11. Felipe ContrerasMay 9, 2014
  12. Erik Faye-LundMay 9, 2014
  13. Felipe ContrerasMay 9, 2014
  14. Erik Faye-LundMay 9, 2014
  15. David KastrupMay 9, 2014
  16. Felipe ContrerasMay 9, 2014
  17. David KastrupMay 9, 2014
  18. Felipe ContrerasMay 9, 2014
  19. David KastrupMay 9, 2014
  20. Jonathan NiederMay 9, 2014
  21. 05/25 contrib: remove 'convert-objects'Felipe Contreras, May 9, 2014
  22. 06/25 contrib: remove 'diffall'Felipe Contreras, May 9, 2014
  23. Tim HeniganMay 9, 2014
  24. Jonathan NiederMay 9, 2014
  25. Tim HeniganMay 9, 2014
  26. Jonathan NiederMay 9, 2014
  27. Tim HeniganMay 9, 2014
  28. 07/25 contrib: remove 'git-jump'Felipe Contreras, May 9, 2014
  29. Jeff KingMay 9, 2014
  30. Felipe ContrerasMay 9, 2014
  31. Jeff KingMay 9, 2014
  32. Felipe ContrerasMay 9, 2014
  33. Junio C HamanoMay 9, 2014
  34. 08/25 contrib: remove 'git-shell-commands'Felipe Contreras, May 9, 2014
  35. 09/25 contrib: remove 'gitview'Felipe Contreras, May 9, 2014
  36. 10/25 contrib: reomve 'thunderbird-patch-inline'Felipe Contreras, May 9, 2014
  37. 11/25 contrib: remove 'workdir'Felipe Contreras, May 9, 2014
  38. 12/25 contrib: remove 'vim'Felipe Contreras, May 9, 2014
  39. Jeff KingMay 9, 2014
  40. Jonathan NiederMay 9, 2014
  41. 13/25 contrib: remove 'svn-fe'Felipe Contreras, May 9, 2014
  42. 14/25 contrib: remove 'rerere-train'Felipe Contreras, May 9, 2014
  43. 15/25 contrib: remove 'remotes2config'Felipe Contreras, May 9, 2014
  44. 16/25 contrib: remove 'persistent-https'Felipe Contreras, May 9, 2014
  45. 17/25 contrib: remove 'git-resurrect'Felipe Contreras, May 9, 2014
  46. 18/25 contrib: remove 'emacs'Felipe Contreras, May 9, 2014
  47. 19/25 contrib: remove 'diff-highlight'Felipe Contreras, May 9, 2014
  48. Jeff KingMay 9, 2014
  49. Felipe ContrerasMay 9, 2014
  50. Stefan BellerMay 9, 2014
  51. Felipe ContrerasMay 9, 2014
  52. Junio C HamanoMay 9, 2014
  53. Felipe ContrerasMay 9, 2014
  54. Junio C HamanoMay 9, 2014
  55. Felipe ContrerasMay 9, 2014
  56. Junio C HamanoMay 9, 2014
  57. Felipe ContrerasMay 9, 2014
  58. 20/25 contrib: remove 'contacts'Felipe Contreras, May 9, 2014
  59. brian m. carlsonMay 10, 2014
  60. Felipe ContrerasMay 10, 2014
  61. 22/25 contrib: remove 'fast-import'Felipe Contreras, May 9, 2014
  62. 24/25 contrib: remove 'hooks'Felipe Contreras, May 9, 2014
  63. Martin LanghoffMay 9, 2014
  64. Johannes SixtMay 9, 2014
  65. Felipe ContrerasMay 9, 2014
  66. Stefan BellerMay 9, 2014
  67. Jeff KingMay 9, 2014
  68. Felipe ContrerasMay 9, 2014
  69. Martin LanghoffMay 9, 2014
  70. Felipe ContrerasMay 9, 2014
  71. Felipe ContrerasMay 9, 2014
  72. Felipe ContrerasMay 9, 2014
  73. Matthieu MoyMay 9, 2014
  74. Felipe ContrerasMay 9, 2014
  75. Stefan BellerMay 9, 2014
  76. Alexandre JulliardMay 9, 2014
  77. Felipe ContrerasMay 9, 2014
  78. Michael HaggertyMay 9, 2014
  79. David KastrupMay 9, 2014
  80. Michael HaggertyMay 9, 2014
  81. Felipe ContrerasMay 9, 2014
  82. James DenholmMay 9, 2014
  83. Felipe ContrerasMay 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.