git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC PATCH 0/1] for-each-ref: Add '--no-symbolic' option
@ 2019-09-07 21:36 Eric Freese
  2019-09-07 21:36 ` [RFC PATCH 1/1] for-each-ref: add " Eric Freese
  2019-09-07 23:16 ` [RFC PATCH 0/1] for-each-ref: Add " Taylor Blau
  0 siblings, 2 replies; 13+ messages in thread
From: Eric Freese @ 2019-09-07 21:36 UTC (permalink / raw)
  To: git; +Cc: Eric Freese

Hi,

I was recently using git-for-each-ref in a script to get a list of
remote refs that pointed at a particular commit so that they could
automatically be updated and pushed back to that remote. This fails when
it comes across refs/remotes/origin/HEAD, which is a symbolic link.

I was able to solve the problem with:

```
git for-each-ref ... --format="%(refname) %(symref)" | grep " $"
```

But that feels a little clumsy to me. I would have expected there to be
a flag like `--no-symbolic` that would exclude symbolic refs from the
output. So I went ahead and added it :)

I could forsee this option also being added to git-branch and git-tag,
but decided to keep it to git-for-each-ref to test the waters before
investing any further time into it.

Cheers

Eric Freese (1):
  for-each-ref: add '--no-symbolic' option

 Documentation/git-for-each-ref.txt | 3 +++
 builtin/for-each-ref.c             | 4 +++-
 ref-filter.c                       | 4 ++++
 ref-filter.h                       | 3 ++-
 t/t6302-for-each-ref-filter.sh     | 6 ++++++
 5 files changed, 18 insertions(+), 2 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-09-09 18:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-07 21:36 [RFC PATCH 0/1] for-each-ref: Add '--no-symbolic' option Eric Freese
2019-09-07 21:36 ` [RFC PATCH 1/1] for-each-ref: add " Eric Freese
2019-09-07 23:28   ` Taylor Blau
2019-09-07 23:39     ` Taylor Blau
2019-09-08  9:44     ` Jeff King
2019-09-07 23:37   ` Taylor Blau
2019-09-08 10:05   ` Jeff King
2019-09-08 15:40     ` Junio C Hamano
2019-09-08 22:34       ` Junio C Hamano
2019-09-09  4:01         ` Eric Freese
2019-09-09 12:57           ` Jeff King
2019-09-09 18:08           ` Junio C Hamano
2019-09-07 23:16 ` [RFC PATCH 0/1] for-each-ref: Add " Taylor Blau

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).