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

[PATCH v1 17/25] contrib: remove 'git-resurrect'

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 9, 2014, 00:58 UTC
Message-ID
<1399597116-1851-18-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1399597116-1851-1-git-send-email-felipe.contreras@gmail.com>
No activity, no documentation, no tests, no chance of ever graduating.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/git-resurrect.sh | 182 -----------------------------------------------
 1 file changed, 182 deletions(-)
 delete mode 100755 contrib/git-resurrect.sh
diff --git a/contrib/git-resurrect.sh b/contrib/git-resurrect.sh
deleted file mode 100755
index d7e97bb..0000000
--- a/contrib/git-resurrect.sh
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/bin/sh
-
-USAGE="[-a] [-r] [-m] [-t] [-n] [-b <newname>] <name>"
-LONG_USAGE="git-resurrect attempts to find traces of a branch tip
-called <name>, and tries to resurrect it.  Currently, the reflog is
-searched for checkout messages, and with -r also merge messages.  With
--m and -t, the history of all refs is scanned for Merge <name> into
-other/Merge <other> into <name> (respectively) commit subjects, which
-is rather slow but allows you to resurrect other people's topic
-branches."
-
-OPTIONS_KEEPDASHDASH=
-OPTIONS_STUCKLONG=
-OPTIONS_SPEC="\
-git resurrect $USAGE
---
-b,branch=            save branch as <newname> instead of <name>
-a,all                same as -l -r -m -t
-k,keep-going         full rev-list scan (instead of first match)
-l,reflog             scan reflog for checkouts (enabled by default)
-r,reflog-merges      scan for merges recorded in reflog
-m,merges             scan for merges into other branches (slow)
-t,merge-targets      scan for merges of other branches into <name>
-n,dry-run            don't recreate the branch"
-
-. git-sh-setup
-
-search_reflog () {
-        sed -ne 's~^\([^ ]*\) .*\tcheckout: moving from '"$1"' .*~\1~p' \
-                < "$GIT_DIR"/logs/HEAD
-}
-
-search_reflog_merges () {
-	git rev-parse $(
-		sed -ne 's~^[^ ]* \([^ ]*\) .*\tmerge '"$1"':.*~\1^2~p' \
-			< "$GIT_DIR"/logs/HEAD
-	)
-}
-
-_x40="[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
-
-search_merges () {
-        git rev-list --all --grep="Merge branch '$1'" \
-                --pretty=tformat:"%P %s" |
-        sed -ne "/^$_x40 \($_x40\) Merge .*/ {s//\1/p;$early_exit}"
-}
-
-search_merge_targets () {
-	git rev-list --all --grep="Merge branch '[^']*' into $branch\$" \
-		--pretty=tformat:"%H %s" --all |
-	sed -ne "/^\($_x40\) Merge .*/ {s//\1/p;$early_exit} "
-}
-
-dry_run=
-early_exit=q
-scan_reflog=t
-scan_reflog_merges=
-scan_merges=
-scan_merge_targets=
-new_name=
-
-while test "$#" != 0; do
-	case "$1" in
-	    -b|--branch)
-		shift
-		new_name="$1"
-		;;
-	    -n|--dry-run)
-		dry_run=t
-		;;
-	    --no-dry-run)
-		dry_run=
-		;;
-	    -k|--keep-going)
-		early_exit=
-		;;
-	    --no-keep-going)
-		early_exit=q
-		;;
-	    -m|--merges)
-		scan_merges=t
-		;;
-	    --no-merges)
-		scan_merges=
-		;;
-	    -l|--reflog)
-		scan_reflog=t
-		;;
-	    --no-reflog)
-		scan_reflog=
-		;;
-	    -r|--reflog_merges)
-		scan_reflog_merges=t
-		;;
-	    --no-reflog_merges)
-		scan_reflog_merges=
-		;;
-	    -t|--merge-targets)
-		scan_merge_targets=t
-		;;
-	    --no-merge-targets)
-		scan_merge_targets=
-		;;
-	    -a|--all)
-		scan_reflog=t
-		scan_reflog_merges=t
-		scan_merges=t
-		scan_merge_targets=t
-		;;
-	    --)
-		shift
-		break
-		;;
-	    *)
-		usage
-		;;
-	esac
-	shift
-done
-
-test "$#" = 1 || usage
-
-all_strategies="$scan_reflog$scan_reflog_merges$scan_merges$scan_merge_targets"
-if test -z "$all_strategies"; then
-	die "must enable at least one of -lrmt"
-fi
-
-branch="$1"
-test -z "$new_name" && new_name="$branch"
-
-if test ! -z "$scan_reflog"; then
-	if test -r "$GIT_DIR"/logs/HEAD; then
-		candidates="$(search_reflog $branch)"
-	else
-		die 'reflog scanning requested, but' \
-			'$GIT_DIR/logs/HEAD not readable'
-	fi
-fi
-if test ! -z "$scan_reflog_merges"; then
-	if test -r "$GIT_DIR"/logs/HEAD; then
-		candidates="$candidates $(search_reflog_merges $branch)"
-	else
-		die 'reflog scanning requested, but' \
-			'$GIT_DIR/logs/HEAD not readable'
-	fi
-fi
-if test ! -z "$scan_merges"; then
-	candidates="$candidates $(search_merges $branch)"
-fi
-if test ! -z "$scan_merge_targets"; then
-	candidates="$candidates $(search_merge_targets $branch)"
-fi
-
-candidates="$(git rev-parse $candidates | sort -u)"
-
-if test -z "$candidates"; then
-	hint=
-	test "z$all_strategies" != "ztttt" \
-		&& hint=" (maybe try again with -a)"
-	die "no candidates for $branch found$hint"
-fi
-
-echo "** Candidates for $branch **"
-for cmt in $candidates; do
-	git --no-pager log --pretty=tformat:"%ct:%h [%cr] %s" --abbrev-commit -1 $cmt
-done \
-| sort -n | cut -d: -f2-
-
-newest="$(git rev-list -1 $candidates)"
-if test ! -z "$dry_run"; then
-	printf "** Most recent: "
-	git --no-pager log -1 --pretty=tformat:"%h %s" $newest
-elif ! git rev-parse --verify --quiet $new_name >/dev/null; then
-	printf "** Restoring $new_name to "
-	git --no-pager log -1 --pretty=tformat:"%h %s" $newest
-	git branch $new_name $newest
-else
-	printf "Most recent: "
-	git --no-pager log -1 --pretty=tformat:"%h %s" $newest
-	echo "** $new_name already exists, doing nothing"
-fi
-- 
1.9.2+fc1.27.gbce2056
Previous: Felipe ContrerasNext: Felipe Contreras
Message 45 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.