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

Re: [PATCH] fix git-parse-remote.sh for remotes that contain slashes

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2011, 19:55 UTC
Message-ID
<7vd3nzntuf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1295005000-11562-1-git-send-email-stefan.naewe@gmail.com>
Stefan Naewe <stefan.naewe@gmail.com> writes:
> Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
> ---
Thanks, but no explanation?

Imagine somebody who weren't reading this thread (especially the article you responded to with this patch) sees this in "git log" output stream. For that matter, imagine yourself doing that in 2012 when the motivation of this change you all forgot already.

Do you think it is obvious what the problem the patch tried to fix was? I don't. "fix" on the subject line gives you 0-bit information for that purpose.

Show 16 quoted lines
> diff --git a/git-parse-remote.sh b/git-parse-remote.sh
> index 5f47b18..7cf204e 100644
> --- a/git-parse-remote.sh
> +++ b/git-parse-remote.sh
> @@ -7,8 +7,12 @@ GIT_DIR=$(git rev-parse -q --git-dir) || :;
>  get_data_source () {
>  	case "$1" in
>  	*/*)
> -		echo ''
> -		;;
> +		if test "$(git config --get "remote.$1.url")"
> +		then
> +			echo config
> +		else
> +			echo ''
> +		fi ;;

I suspect that making this case arm trigger not on */* but only on /* and ../* would be a lot more sensible solution. Otherwise you would still have the same issue in repositories that use remotes/ and branches/ mechanism.

 git-parse-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 1cc2ba6..8ec33e3 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -6,7 +6,7 @@ GIT_DIR=$(git rev-parse -q --git-dir) || :;
 
 get_data_source () {
 	case "$1" in
-	*/*)
+	../* | /*)
 		echo ''
 		;;
 	.)
Previous: Stefan NaeweNext: Uwe Kleine-König
Message 3 of 8 in “bug: request-pull broken when remote name contains a slash”
  1. Uwe Kleine-KönigJan 14, 2011
  2. fix git-parse-remote.sh for remotes that contain slashesStefan Naewe, Jan 14, 2011
  3. Junio C HamanoJan 14, 2011
  4. get_remote_url(): use the same data source as ls-remote to get remote urlsUwe Kleine-König, Feb 28, 2011
  5. Junio C HamanoFeb 28, 2011
  6. Uwe Kleine-KönigMar 1, 2011
  7. 1/2 get_remote_url(): use the same data source as ls-remote to get remote urlsUwe Kleine-König, Mar 1, 2011
  8. 2/2 git-request-pull: open-code the only invocation of get_remote_urlUwe Kleine-König, Mar 1, 2011

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.