ls-remote: introduce symref argument
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 1 replyIn review
- v25 patches 13 repliesSuperseded
- v14 patches 12 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | ls-remote: document --quiet optionDocumentation/ | +5 | 0 replies | |
| 2/5 | ls-remote: document --refs optionDocumentation/ builtin/ | +5 | 0 replies | |
| 3/5 | ls-remote: fix synopsisDocumentation/ | +1 | 0 replies | |
| 4/5 | ls-remote: use parse-options apibuiltin/ | +29 | 0 replies | |
| 5/5 | ls-remote: add support for showing symrefsDocumentation/ builtin/ t/ | +61 | 0 replies |
Reviews trailers per patch
None of the 5 patches has a Reviewed-by or Acked-by.
| Patch | Jeff King |
|---|---|
| 1/5 | |
| 2/5 | |
| 3/5 | |
| 4/5 | Helped-by |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/5] ls-remote: introduce symref argument
The previous rounds are at $gmane/284248. Thanks to Peff and Junio for reviewing and suggestions on the previous round.
Changes from the previous round:
- Slightly reworded the documentation for the --refs option
- Small fix in the commit message of patch 4.
- use <<-\EOF instead of <<-EOF in the tests
- added a note about upload-pack only showing the HEAD symref
- squashed in tests by peff
- changed --symrefs option to --symref
- reworded description and documentation of the option according to comments from junio.
Interdiff below:
Documentation/git-ls-remote.txt +7 -5
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>] [-q | --quiet] [--exit-code] [--get-url] - [--symrefs] [<repository> [<refs>...]] + [--symref] [<repository> [<refs>...]] DESCRIPTION -----------
@@ -31,8 +31,7 @@ OPTIONS displayed. --refs:: - Do not show peeled tags or pseudo-refs like HEAD or MERGE_HEAD - in the output. + Do not show peeled tags or pseudorefs like HEAD in the output. -q:: --quiet::
@@ -55,8 +54,11 @@ OPTIONS "url.<base>.insteadOf" config setting (See linkgit:git-config[1]) and exit without talking to the remote. ---symrefs:: - Show the symrefs in addition to the other refs. +--symref:: + In addition to the object pointed by it, show the underlying + ref pointed by it when showing a symbolic ref. Currently, + upload-pack only shows the symref HEAD, so it will be the only + one shown by ls-remote. <repository>:: The "remote" repository to query. This parameter can be
builtin/ls-remote.c +5 -4
@@ -6,7 +6,7 @@static const char *const ls_remote_usage[] = {N_ ("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n" " [-q | --quiet] [--exit-code] [--get-url]\n" -" [--symrefs] [<repository> [<refs>...]]" ), +" [--symref] [<repository> [<refs>...]]" ),NULL };
@@ -38,7 +38,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)int get_url =0 ;int quiet =0 ;int status =0 ; -int symrefs =0 ; +int show_symref_target =0 ;const char *uploadpack =NULL ;const char **pattern =NULL ;
@@ -60,7 +60,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) N_("take url.<base>.insteadOf into account")),OPT_SET_INT (0 ,"exit-code" , &status,N_ ("exit with exit code 2 if no matching refs are found" ),2 ), -OPT_BOOL (0 ,"symrefs" , &symrefs,N_ ("show symrefs" )), +OPT_BOOL (0 ,"symref" , &show_symref_target, +N_ ("show underlying ref in addition to the object pointed by it" )), OPT_END() };
@@ -104,7 +105,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)continue ;if (!tail_match (pattern, ref->name))continue ; -if (symrefs && ref->symref) +if (show_symref_target && ref->symref)printf ("ref: %s\t%s\n" , ref->symref, ref->name);printf ("%s\t%s\n" ,oid_to_hex (&ref->old_oid), ref->name); status =0 ;/* we found something */
t/t5512-ls-remote.sh +29 -6
@@ -163,8 +163,8 @@ test_expect_success 'overrides work between mixed transfer/upload-pack hideRefs' grep refs/tags/magic actual ' -test_expect_success 'ls-remote --symrefs' ' - cat >expect <<-EOF && +test_expect_success 'ls-remote --symref' ' + cat >expect <<-\EOF && ref: refs/heads/master HEAD 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master
@@ -172,17 +172,40 @@ test_expect_success 'ls-remote --symrefs' ' 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/remotes/origin/master 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/tags/mark EOF - git ls-remote --symrefs >actual && + git ls-remote --symref >actual && test_cmp expect actual ' -test_expect_success 'ls-remote with filtered symrefs' ' - cat >expect <<-EOF && +test_expect_success 'ls-remote with filtered symref (refname)' ' + cat >expect <<-\EOF && ref: refs/heads/master HEAD 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD EOF - git ls-remote --symrefs . HEAD >actual && + git ls-remote --symref . HEAD >actual && test_cmp expect actual ' +test_expect_failure 'ls-remote with filtered symref (--heads)' ' + git symbolic-ref refs/heads/foo refs/tags/mark && + cat >expect <<-\EOF && + ref: refs/tags/mark refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + EOF + git ls-remote --symref --heads . >actual && + test_cmp expect actual +' + +test_expect_success 'ls-remote --symref omits filtered-out matches' ' + cat >expect <<-\EOF && + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + EOF + git ls-remote --symref --heads . >actual && + test_cmp expect actual && + git ls-remote --symref . "refs/heads/*" >actual && + test_cmp expect actual +' + + test_done
Thomas Gummerer (5):
ls-remote: document --quiet option
ls-remote: document --refs option
ls-remote: fix synopsis
ls-remote: use parse-options api
ls-remote: add support for showing symrefs
Documentation/git-ls-remote.txt | 16 +++++++- builtin/ls-remote.c | 90 +++++++++++++++++------------------------ t/t5512-ls-remote.sh | 45 +++++++++++++++++++++ 3 files changed, 95 insertions(+), 56 deletions(-)
Signature · 1 line
2.7.0.30.g56a8654.dirty