git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Michael Haggerty <mhagger@alum.mit.edu>
Subject: [RFC 10/11] remote show: allow --prune=<pattern> options
Date: Wed,  4 Dec 2013 06:44:49 +0100	[thread overview]
Message-ID: <1386135890-13954-11-git-send-email-mhagger@alum.mit.edu> (raw)
In-Reply-To: <1386135890-13954-1-git-send-email-mhagger@alum.mit.edu>

By default, show the remote-tracking references that could be pruned.
But if the user specifies --prune=<pattern>, then limit the output to
those matching pattern.  And if the user specified --no-prune, then do
not look for stale remote-tracking references at all.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 Documentation/git-remote.txt | 6 ++++++
 builtin/remote.c             | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 9cbc986..dd48474 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -147,6 +147,12 @@ error.
 
 Gives some information about the remote <name>.
 +
+With `--prune`, display stale remote-tracking branches that no longer
+exist on the remote (this is the default).  With `--prune=<pattern>`,
+only report stale references whose names match <pattern> (this option
+can be used multiple times).  With `--no-prune`, do not report stale
+remote-tracking references at all.
++
 With `-n` option, the remote heads are not queried first with
 `git ls-remote <name>`; cached information is used instead.
 
diff --git a/builtin/remote.c b/builtin/remote.c
index e1d43e2..293d82d 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1165,6 +1165,9 @@ static int show(int argc, const char **argv)
 	int no_query = 0, result = 0, query_flag = 0;
 	struct prune_option prune_option = PRUNE_OPTION_INIT;
 	struct option options[] = {
+		{ OPTION_CALLBACK, 0, "prune", &prune_option, N_("pattern"),
+			N_("show prunable remote-tracking branches (matching pattern, if specified)"),
+			PARSE_OPT_OPTARG, prune_option_parse },
 		OPT_BOOL('n', NULL, &no_query, N_("do not query remotes")),
 		OPT_END()
 	};
-- 
1.8.4.3

  parent reply	other threads:[~2013-12-04  5:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04  5:44 [RFC 00/11] Make reference pruning more configurable Michael Haggerty
2013-12-04  5:44 ` [RFC 01/11] get_stale_heads(): allow limiting to refname patterns Michael Haggerty
2013-12-04  5:44 ` [RFC 02/11] remote.c: add infrastructure for parsing --prune options Michael Haggerty
2013-12-04 12:57   ` Duy Nguyen
2013-12-04 17:04     ` Michael Haggerty
2013-12-04  5:44 ` [RFC 03/11] fetch: use the new functions for handling " Michael Haggerty
2013-12-04  5:44 ` [RFC 04/11] remote: " Michael Haggerty
2013-12-04  5:44 ` [RFC 05/11] remote.c: add infrastructure to handle --prune=<pattern> Michael Haggerty
2013-12-04  5:44 ` [RFC 06/11] fetch --prune: allow refname patterns to be specified Michael Haggerty
2013-12-04  5:44 ` [RFC 07/11] remote update " Michael Haggerty
2013-12-04  5:44 ` [RFC 08/11] string_list_append_list(): new function Michael Haggerty
2013-12-04  5:44 ` [RFC 09/11] remote prune: allow --prune=<pattern> options Michael Haggerty
2013-12-04  5:44 ` Michael Haggerty [this message]
2013-12-04  5:44 ` [RFC 11/11] remote: allow prune patterns to be configured Michael Haggerty
2013-12-04 20:25 ` [RFC 00/11] Make reference pruning more configurable Junio C Hamano

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=1386135890-13954-11-git-send-email-mhagger@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).