Skip to content

RFC for-each-ref: Add '--no-symbolic' option

Eric Freese git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1for-each-ref: add '--no-symbolic' optionDocumentation/git-for-each-ref.txt builtin/for-each-ref.c ref-filter.c +2 more+18 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/1] for-each-ref: Add '--no-symbolic' option

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(-)
Signature · 1 line
2.23.0