From d08bae7e221727e26baab984b792854b842130d7 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 20 Jan 2010 11:48:25 +0200 Subject: rev-parse --glob Add --glob= option to rev-parse and everything that accepts its options. This option matches all refs that match given shell glob pattern (complete with some DWIM logic). Example: 'git log --branches --not --glob=remotes/origin' To show what you have that origin doesn't. Signed-off-by: Ilari Liusvaara Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation/git-rev-parse.txt') diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 82045a2522..6eb8c14f62 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -112,6 +112,11 @@ OPTIONS --remotes:: Show tag refs found in `$GIT_DIR/refs/remotes`. +--glob=glob-pattern:: + Show refs matching shell glob pattern `glob-pattern`. If pattern + specified lacks leading 'refs/', it is automatically prepended. + If pattern lacks '?', '*', or '[', '/*' at the end is impiled. + --show-prefix:: When the command is invoked from a subdirectory, show the path of the current directory relative to the top-level -- cgit v1.2.3 From b09fe971dea73ff6f5296ce533a566114b23ca4e Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 20 Jan 2010 11:48:26 +0200 Subject: rev-parse --branches/--tags/--remotes=pattern Since local branch, tags and remote tracking branch namespaces are most often used, add shortcut notations for globbing those in manner similar to --glob option. With this, one can express the "what I have but origin doesn't?" as: 'git log --branches --not --remotes=origin' Original-idea-by: Johannes Sixt Signed-off-by: Ilari Liusvaara Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Documentation/git-rev-parse.txt') diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 6eb8c14f62..afe8699999 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -103,14 +103,21 @@ OPTIONS --all:: Show all refs found in `$GIT_DIR/refs`. ---branches:: - Show branch refs found in `$GIT_DIR/refs/heads`. +--branches[=pattern]:: + Show branch refs found in `$GIT_DIR/refs/heads`. If `pattern` + is given, only branches matching given shell glob are shown. + If pattern lacks '?', '*', or '[', '/*' at the end is impiled. ---tags:: - Show tag refs found in `$GIT_DIR/refs/tags`. +--tags[=pattern]:: + Show tag refs found in `$GIT_DIR/refs/tags`. If `pattern` + is given, only tags matching given shell glob are shown. + If pattern lacks '?', '*', or '[', '/*' at the end is impiled. ---remotes:: - Show tag refs found in `$GIT_DIR/refs/remotes`. +--remotes[=pattern]:: + Show tag refs found in `$GIT_DIR/refs/remotes`. If `pattern` + is given, only remote tracking branches matching given shell glob + are shown. If pattern lacks '?', '*', or '[', '/*' at the end is + impiled. --glob=glob-pattern:: Show refs matching shell glob pattern `glob-pattern`. If pattern -- cgit v1.2.3 From e2b53e58081e6a30309625fc6194ccb42772846b Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 22 Jan 2010 01:21:38 +0100 Subject: Documentation: improve description of --glob=pattern and friends Consolidate the descriptions of --branches, --tags and --remotes a bit, to make it less repetitive. Improve the grammar a bit, and spell out the meaning of the 'append /*' rule. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'Documentation/git-rev-parse.txt') diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index afe8699999..61f4835a10 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -104,25 +104,23 @@ OPTIONS Show all refs found in `$GIT_DIR/refs`. --branches[=pattern]:: - Show branch refs found in `$GIT_DIR/refs/heads`. If `pattern` - is given, only branches matching given shell glob are shown. - If pattern lacks '?', '*', or '[', '/*' at the end is impiled. - --tags[=pattern]:: - Show tag refs found in `$GIT_DIR/refs/tags`. If `pattern` - is given, only tags matching given shell glob are shown. - If pattern lacks '?', '*', or '[', '/*' at the end is impiled. - --remotes[=pattern]:: - Show tag refs found in `$GIT_DIR/refs/remotes`. If `pattern` - is given, only remote tracking branches matching given shell glob - are shown. If pattern lacks '?', '*', or '[', '/*' at the end is - impiled. - ---glob=glob-pattern:: - Show refs matching shell glob pattern `glob-pattern`. If pattern - specified lacks leading 'refs/', it is automatically prepended. - If pattern lacks '?', '*', or '[', '/*' at the end is impiled. + Show all branches, tags, or remote-tracking branches, + respectively (i.e., refs found in `$GIT_DIR/refs/heads`, + `$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`, + respectively). ++ +If a `pattern` is given, only refs matching the given shell glob are +shown. If the pattern does not contain a globbing character (`?`, +`\*`, or `[`), it is turned into a prefix match by appending `/\*`. + +--glob=pattern:: + Show all refs matching the shell glob pattern `pattern`. If + the pattern does not start with `refs/`, this is automatically + prepended. If the pattern does not contain a globbing + character (`?`, `\*`, or `[`), it is turned into a prefix + match by appending `/\*`. --show-prefix:: When the command is invoked from a subdirectory, show the -- cgit v1.2.3