git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Freese <ericdfreese@gmail.com>
Date
Sep 7, 2019, 21:36 UTC
Message-ID
<20190907213646.21231-1-ericdfreese@gmail.com>
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
Next: Eric Freese
Message 1 of 13 in “for-each-ref: Add '--no-symbolic' option”
  1. 0/1 for-each-ref: Add '--no-symbolic' optionEric Freese, Sep 7, 2019
  2. 1/1 for-each-ref: add '--no-symbolic' optionEric Freese, Sep 7, 2019
  3. Taylor BlauSep 7, 2019
  4. Taylor BlauSep 7, 2019
  5. Jeff KingSep 8, 2019
  6. Taylor BlauSep 7, 2019
  7. Jeff KingSep 8, 2019
  8. Junio C HamanoSep 8, 2019
  9. Junio C HamanoSep 8, 2019
  10. Eric FreeseSep 9, 2019
  11. Jeff KingSep 9, 2019
  12. Junio C HamanoSep 9, 2019
  13. Taylor BlauSep 7, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.