git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 2/2] parse-remote: remove this now-unused library
Date: Thu, 12 Nov 2020 12:31:55 -0800	[thread overview]
Message-ID: <20201112203155.3342586-3-gitster@pobox.com> (raw)
In-Reply-To: <20201112203155.3342586-1-gitster@pobox.com>

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Since the previous step stopped dot-sourcing it from
git-submodule.sh, nothing uses git-parse-remote, which
still has two unused functions.  Remove the dead code
together with the file itself and documentation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 .gitignore                         |  1 -
 Documentation/git-parse-remote.txt | 23 --------
 Makefile                           |  2 -
 command-list.txt                   |  1 -
 git-parse-remote.sh                | 94 ------------------------------
 5 files changed, 121 deletions(-)
 delete mode 100644 Documentation/git-parse-remote.txt
 delete mode 100644 git-parse-remote.sh

diff --git a/.gitignore b/.gitignore
index 6232d33924..9da275e4e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -114,7 +114,6 @@
 /git-pack-redundant
 /git-pack-objects
 /git-pack-refs
-/git-parse-remote
 /git-patch-id
 /git-prune
 /git-prune-packed
diff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt
deleted file mode 100644
index a45ea1ece8..0000000000
--- a/Documentation/git-parse-remote.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-git-parse-remote(1)
-===================
-
-NAME
-----
-git-parse-remote - Routines to help parsing remote repository access parameters
-
-
-SYNOPSIS
---------
-[verse]
-'. "$(git --exec-path)/git-parse-remote"'
-
-DESCRIPTION
------------
-This script is included in various scripts to supply
-routines to parse files under $GIT_DIR/remotes/ and
-$GIT_DIR/branches/ and configuration variables that are related
-to fetching, pulling and pushing.
-
-GIT
----
-Part of the linkgit:git[1] suite
diff --git a/Makefile b/Makefile
index 1fb0ec1705..9c154a2666 100644
--- a/Makefile
+++ b/Makefile
@@ -613,7 +613,6 @@ SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
 
 SCRIPT_LIB += git-mergetool--lib
-SCRIPT_LIB += git-parse-remote
 SCRIPT_LIB += git-rebase--preserve-merges
 SCRIPT_LIB += git-sh-i18n
 SCRIPT_LIB += git-sh-setup
@@ -2577,7 +2576,6 @@ XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
 	--keyword=__ --keyword=N__ --keyword="__n:1,2"
 LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 LOCALIZED_SH = $(SCRIPT_SH)
-LOCALIZED_SH += git-parse-remote.sh
 LOCALIZED_SH += git-rebase--preserve-merges.sh
 LOCALIZED_SH += git-sh-setup.sh
 LOCALIZED_PERL = $(SCRIPT_PERL)
diff --git a/command-list.txt b/command-list.txt
index 0e3204e7d1..c19c8a94fe 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -135,7 +135,6 @@ git-p4                                  foreignscminterface
 git-pack-objects                        plumbingmanipulators
 git-pack-redundant                      plumbinginterrogators
 git-pack-refs                           ancillarymanipulators
-git-parse-remote                        synchelpers
 git-patch-id                            purehelpers
 git-prune                               ancillarymanipulators   complete
 git-prune-packed                        plumbingmanipulators
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
deleted file mode 100644
index 0c2a5ef6c4..0000000000
--- a/git-parse-remote.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-# This is a shell library to calculate the remote repository and
-# upstream branch that should be pulled by "git pull" from the current
-# branch.
-
-# git-ls-remote could be called from outside a git managed repository;
-# this would fail in that case and would issue an error message.
-GIT_DIR=$(git rev-parse -q --git-dir) || :;
-
-get_remote_merge_branch () {
-	case "$#" in
-	0|1)
-	    origin="$1"
-	    default=$(get_default_remote)
-	    test -z "$origin" && origin=$default
-	    curr_branch=$(git symbolic-ref -q HEAD) &&
-	    [ "$origin" = "$default" ] &&
-	    echo $(git for-each-ref --format='%(upstream)' $curr_branch)
-	    ;;
-	*)
-	    repo=$1
-	    shift
-	    ref=$1
-	    # FIXME: It should return the tracking branch
-	    #        Currently only works with the default mapping
-	    case "$ref" in
-	    +*)
-		ref=$(expr "z$ref" : 'z+\(.*\)')
-		;;
-	    esac
-	    expr "z$ref" : 'z.*:' >/dev/null || ref="${ref}:"
-	    remote=$(expr "z$ref" : 'z\([^:]*\):')
-	    case "$remote" in
-	    '' | HEAD ) remote=HEAD ;;
-	    heads/*) remote=${remote#heads/} ;;
-	    refs/heads/*) remote=${remote#refs/heads/} ;;
-	    refs/* | tags/* | remotes/* ) remote=
-	    esac
-	    [ -n "$remote" ] && case "$repo" in
-		.)
-		    echo "refs/heads/$remote"
-		    ;;
-		*)
-		    echo "refs/remotes/$repo/$remote"
-		    ;;
-	    esac
-	esac
-}
-
-error_on_missing_default_upstream () {
-	cmd="$1"
-	op_type="$2"
-	op_prep="$3" # FIXME: op_prep is no longer used
-	example="$4"
-	branch_name=$(git symbolic-ref -q HEAD)
-	display_branch_name="${branch_name#refs/heads/}"
-	# If there's only one remote, use that in the suggestion
-	remote="$(gettext "<remote>")"
-	branch="$(gettext "<branch>")"
-	if test $(git remote | wc -l) = 1
-	then
-		remote=$(git remote)
-	fi
-
-	if test -z "$branch_name"
-	then
-		gettextln "You are not currently on a branch."
-	else
-		gettextln "There is no tracking information for the current branch."
-	fi
-	case "$op_type" in
-	rebase)
-		gettextln "Please specify which branch you want to rebase against."
-		;;
-	merge)
-		gettextln "Please specify which branch you want to merge with."
-		;;
-	*)
-		echo >&2 "BUG: unknown operation type: $op_type"
-		exit 1
-		;;
-	esac
-	eval_gettextln "See git-\${cmd}(1) for details."
-	echo
-	echo "    $example"
-	echo
-	if test -n "$branch_name"
-	then
-		gettextln "If you wish to set tracking information for this branch you can do so with:"
-		echo
-		echo "    git branch --set-upstream-to=$remote/$branch $display_branch_name"
-		echo
-	fi
-	exit 1
-}
-- 
2.29.2-442-ga30192deef


  parent reply	other threads:[~2020-11-12 20:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 13:47 [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good Johannes Schindelin
2017-05-11 13:47 ` [PATCH 01/11] git-parse-remote: fix highly misleading man page Johannes Schindelin
2017-05-11 17:21   ` Stefan Beller
2017-05-11 19:14     ` Johannes Schindelin
2020-11-11 15:17     ` [PATCH 0/5] Remove now-unused git-parse-remote Ævar Arnfjörð Bjarmason
2020-11-11 17:37       ` Jeff King
2020-11-11 19:29         ` Junio C Hamano
2020-11-12 14:09         ` Ævar Arnfjörð Bjarmason
2020-11-12 18:42           ` Jeff King
2020-11-12 14:19       ` How do I "git fetch" with a custom <refspec> but a default remote? Ævar Arnfjörð Bjarmason
2020-11-12 18:51         ` Jeff King
2020-11-12 19:26           ` Chris Torek
2020-11-12 20:48             ` Jeff King
2020-11-12 21:22               ` Junio C Hamano
2020-11-14 12:12         ` Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 1/5] parse-remote: remove unused GIT_DIR variable Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 2/5] parse-remote: remove long-dead rebase code Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 3/5] parse-remote: remove long-dead git-pull.sh code Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 4/5] parse-remote: move used code to git-submodule.sh Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 5/5] parse-remote: remove this now-unused library Ævar Arnfjörð Bjarmason
2020-11-11 16:33       ` Junio C Hamano
2020-11-12 20:31         ` [PATCH v2 0/2] Retire git-parse-remote Junio C Hamano
2020-11-12 20:31           ` [PATCH v2 1/2] parse-remote: move used code to git-submodule.sh Junio C Hamano
2020-11-12 20:31           ` Junio C Hamano [this message]
2020-11-12 20:49           ` [PATCH v2 0/2] Retire git-parse-remote Jeff King
2020-11-12 21:25             ` Junio C Hamano
2020-11-13  9:42           ` Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 0/3] submodule sh->C & retire parse-remote Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 1/3] submodule: use "fetch" logic instead of custom remote discovery Ævar Arnfjörð Bjarmason
2020-11-16 21:13             ` Junio C Hamano
2020-11-14 12:21           ` [PATCH v3 2/3] submodule: remove sh function in favor of helper Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 3/3] parse-remote: remove this now-unused library Ævar Arnfjörð Bjarmason
2020-11-16 21:19             ` Junio C Hamano
2020-11-17 14:24               ` Ævar Arnfjörð Bjarmason
2017-05-11 13:47 ` [PATCH 02/11] Documentation: really deprecate .git/remotes/ and .git/branches/ Johannes Schindelin
2017-05-11 13:47 ` [PATCH 03/11] remote: warn loud and clear when .git/branches/ is *still* used Johannes Schindelin
2017-05-11 13:47 ` [PATCH 04/11] remote: warn loud and clear when .git/remotes/ " Johannes Schindelin
2017-05-11 13:47 ` [PATCH 05/11] Revert "Revert "Don't create the $GIT_DIR/branches directory on init"" Johannes Schindelin
2017-05-11 17:26   ` Stefan Beller
2017-05-11 13:47 ` [PATCH 06/11] PREVIEW: t5510: convert .git/remotes/ test to use a regular remote Johannes Schindelin
2017-05-11 13:47 ` [PATCH 07/11] PREVIEW: t5516: stop testing .git/branches/ functionality Johannes Schindelin
2017-05-11 13:47 ` [PATCH 08/11] PREVIEW: remote: remove support for migrating ancient remotes Johannes Schindelin
2017-05-11 13:48 ` [PATCH 09/11] PREVIEW: t5515: remove .git/remotes/ and .git/branches/ tests Johannes Schindelin
2017-05-11 13:48 ` [PATCH 10/11] PREVIEW: t0060: stop testing support for .git/remotes/ and .git/branches/ Johannes Schindelin
2017-05-11 13:48 ` [PATCH 11/11] PREVIEW: remove " Johannes Schindelin
2017-05-11 18:19   ` Stefan Beller
2017-05-11 19:19     ` Johannes Schindelin
2017-05-12  1:14 ` [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good Junio C Hamano
2017-05-12 10:18   ` Johannes Schindelin
2017-05-16  0:37     ` Junio C Hamano
2017-05-16  8:05       ` Ævar Arnfjörð Bjarmason
2017-05-16  9:06         ` Junio C Hamano
2017-05-16 10:02           ` Ævar Arnfjörð Bjarmason
2017-05-17  0:51             ` Junio C Hamano
2017-05-12 12:00   ` Junio C Hamano
2017-05-12 14:19     ` Johannes Schindelin
2017-05-12 17:38       ` Jonathan Nieder
2017-05-13 10:13         ` Junio C Hamano
2017-05-12 21:11       ` Junio C Hamano
2017-05-15  8:42         ` Johannes Schindelin
2017-05-12  9:11 ` Jeff King
2017-05-12 11:09   ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201112203155.3342586-3-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).