From: Michael Haggerty Date: Wed, 04 Dec 2013 05:44:49 GMT Subject: [RFC 10/11] remote show: allow --prune= options Message-ID: <1386135890-13954-11-git-send-email-mhagger@alum.mit.edu> 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=, 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 --- 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 . + +With `--prune`, display stale remote-tracking branches that no longer +exist on the remote (this is the default). With `--prune=`, +only report stale references whose names match (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 `; 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