From: Dan McGee <dpmcgee@gmail.com>
To: git@vger.kernel.org
Cc: Dan McGee <dpmcgee@gmail.com>
Subject: [PATCH] fetch: show remote name instead of URL if available
Date: Tue, 26 Apr 2011 10:13:27 -0500 [thread overview]
Message-ID: <1303830807-21966-1-git-send-email-dpmcgee@gmail.com> (raw)
We often have a name such as 'origin' available; use it if so rather
than showing the raw URL.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
The old output:
$ git fetch -v
From git://git.kernel.org/pub/scm/git/git
= [up to date] html -> origin/html
...
Versus the new output:
$ ./git fetch -v
From origin
= [up to date] html -> origin/html
...
Alternatively, we could do something like
From origin (git://git.kernel.org/pub/scm/git/git)
but no other command seems to do such a thing. Note that a fetch with a direct
URL rather than a name will still show the URL as before.
Another RFC in this is the behavior of `git ls-remote`- it also shows a URL
when we may have a nice name available, so I can resubmit with that modified as
well if people agree with the change. The difference is porcelain vs plumbing.
-Dan
builtin/fetch.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index f9c41da..01bda5a 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -436,8 +436,12 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
REFCOL_WIDTH, *what ? what : "HEAD");
if (*note) {
if (verbosity >= 0 && !shown_url) {
- fprintf(stderr, _("From %.*s\n"),
- url_len, url);
+ if (remote_name)
+ fprintf(stderr, _("From %s\n"),
+ remote_name);
+ else
+ fprintf(stderr, _("From %.*s\n"),
+ url_len, url);
shown_url = 1;
}
if (verbosity >= 0)
--
1.7.5
next reply other threads:[~2011-04-26 15:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 15:13 Dan McGee [this message]
2011-04-26 17:33 ` [PATCH] fetch: show remote name instead of URL if available Junio C Hamano
2011-04-26 17:36 ` Drew Northup
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1303830807-21966-1-git-send-email-dpmcgee@gmail.com \
--to=dpmcgee@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.
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 NNTP newsgroup(s).