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

[PATCH] git-remote show: Also shorten non-fast-forward refs in the 'push' listing

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Jun 9, 2007, 20:34 UTC
Message-ID
<200706092234.17029.johannes.sixt@telecom.at>

'git-remote show remote-name' lists the refs that are pushed to the remote by showing the 'Push' line from the config file. But before showing it, it shortened 'refs/heads/here:refs/heads/there' to 'here:there'. However, if the Push line is prefixed with a plus, the ref was not shortened.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 git-remote.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-remote.perl b/git-remote.perl
index 5763799..b59cafd 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -258,6 +258,7 @@ sub show_remote {
 	if ($info->{'PUSH'}) {
 		my @pushed = map {
 			s|^refs/heads/||;
+			s|^\+refs/heads/|+|;
 			s|:refs/heads/|:|;
 			$_;
 		} @{$info->{'PUSH'}};
-- 
1.5.2
Message 1 of 1 in “git-remote show: Also shorten non-fast-forward refs in the 'push' listing”
  1. git-remote show: Also shorten non-fast-forward refs in the 'push' listingJohannes Sixt, Jun 9, 2007

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.