From: Tom Miller <jackerran@gmail.com>
To: git@vger.kernel.org
Cc: Tom Miller <jackerran@gmail.com>
Subject: [PATCH 2/3] fetch --prune: Always print header url
Date: Wed, 18 Dec 2013 15:22:55 -0600 [thread overview]
Message-ID: <1387401776-30994-2-git-send-email-jackerran@gmail.com> (raw)
In-Reply-To: <1387401776-30994-1-git-send-email-jackerran@gmail.com>
If fetch --prune is run with no new refs to fetch, but it has refs
to prune. Then, the header url is not printed as it would if there were
new refs to fetch. the following is example output showing this
behavior:
$ git fetch --prune --dry-run origin
x [deleted] (none) -> origin/world
After this patch the output of fetch --prune should look like this:
$ git fetch --prune --dry-run origin
From https://github.com/git/git
x [deleted] (none) -> origin/test
Signed-off-by: Tom Miller <jackerran@gmail.com>
---
builtin/fetch.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index b3145f6..e50b697 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -732,7 +732,8 @@ static int fetch_refs(struct transport *transport, struct ref *ref_map)
return ret;
}
-static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map)
+static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map,
+ const char *raw_url)
{
int result = 0;
struct ref *ref, *stale_refs = get_stale_heads(refs, ref_count, ref_map);
@@ -744,6 +745,7 @@ static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map)
if (!dry_run)
result |= delete_ref(ref->name, NULL, 0);
if (verbosity >= 0) {
+ print_url(raw_url);
fprintf(stderr, " x %-*s %-*s -> %s\n",
TRANSPORT_SUMMARY(_("[deleted]")),
REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name));
@@ -878,11 +880,12 @@ static int do_fetch(struct transport *transport,
* don't care whether --tags was specified.
*/
if (ref_count) {
- prune_refs(refs, ref_count, ref_map);
+ prune_refs(refs, ref_count, ref_map, transport->url);
} else {
prune_refs(transport->remote->fetch,
transport->remote->fetch_refspec_nr,
- ref_map);
+ ref_map,
+ transport->url);
}
}
free_refs(ref_map);
--
1.8.5.1.163.gd7aced9
next prev parent reply other threads:[~2013-12-18 21:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 21:22 [PATCH 1/3] builtin/fetch.c: Add pretty_url() and print_url() Tom Miller
2013-12-18 21:22 ` Tom Miller [this message]
2013-12-18 21:22 ` [PATCH 3/3] fetch --prune: Repair branchname DF conflicts Tom Miller
2013-12-18 21:54 ` Junio C Hamano
2013-12-19 1:48 ` Tom Miller
2013-12-19 6:28 ` Junio C Hamano
2013-12-19 11:44 ` Jeff King
2013-12-19 19:34 ` Junio C Hamano
2013-12-18 21:47 ` [PATCH 1/3] builtin/fetch.c: Add pretty_url() and print_url() Junio C Hamano
2013-12-19 1:18 ` Tom Miller
2013-12-19 17:41 ` Thomas Miller
2013-12-19 22:57 ` [PATCH V2 1/2] fetch --prune: Always print header url Tom Miller
2013-12-19 22:57 ` [PATCH V2 2/2] fetch --prune: Run prune before fetching Tom Miller
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=1387401776-30994-2-git-send-email-jackerran@gmail.com \
--to=jackerran@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).