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

Re: [RFC PATCH] Add "git show --follow-symlinks HEAD:symlink"

From
Stefan Beller <sbeller@google.com>
Date
Apr 13, 2018, 17:28 UTC
Message-ID
<CAGZ79kZDUnxkKfqRnZiLhweJ4HNO5sSGUfxkEvJPGagV4wmtkg@mail.gmail.com>
In-Reply-To
<20180413094314.GA2404@bod>
Hi Michael,
thanks for the patch,
> Thanks for the intial reivew. I updated the patch with a test and
> documentation for the new option. Happy to merge the test into one of
> the existing test files, I read t/README and greping around I did not
> find a place that looked like a good fit.

I think keeping tests as separate as possible is a good idea. Looking at the patch https://public-inbox.org/git/20180413094314.GA2404@bod/

The patch seems reasonable, apart from minor nits: In the test we'd prefer no whitespace on the right side of the redirection, i.e. echo content >foo

Instead of evaluating git commands in shell and assigning it to a variable, we'd prefer to dump it to files:

  git show HEAD:symlink >actual &&
  echo foo >expect &&
  test_cmp expect actual
(instead of content=$(git show HEAD:foo) && test $content == ...)

The reason for this is that the &&-chain will inspect the return code of the git command.

There is a typo &e&.

Can we reword the documentation, such that we do not have an occurrence of "extended SHA-1" ? (By now the Git community came up with a plan to migrate away from SHA-1, hence we'd not want to introduce more dependencies even in the form of documentation for that)

Maybe

Follow symlinks inside the repository when requesting objects in extended revision syntax of the form tree-ish:path-in-tree.

Thanks, Stefan

Previous: Michael VogtNext: Michael Vogt
Message 4 of 12 in “Add "git show --follow-symlinks HEAD:symlink"”
  1. Add "git show --follow-symlinks HEAD:symlink"Michael Vogt, Apr 9, 2018
  2. Ævar Arnfjörð BjarmasonApr 9, 2018
  3. Michael VogtApr 13, 2018
  4. Stefan BellerApr 13, 2018
  5. Michael VogtApr 13, 2018
  6. Ævar Arnfjörð BjarmasonApr 13, 2018
  7. support: git show --follow-symlinks HEAD:symlinkMichael Vogt, Apr 13, 2018
  8. Ævar Arnfjörð BjarmasonApr 13, 2018
  9. show: add --follow-symlinks option for <rev>:<path>Michael Vogt, Apr 16, 2018
  10. show: add --follow-symlinks option for <rev>:<path>Michael Vogt, Apr 16, 2018
  11. Junio C HamanoApr 16, 2018
  12. Michael VogtApr 13, 2018

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.