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

Re: [PATCH v3 3/3] cat-file: add --follow-symlinks to --batch

From
Junio C Hamano <gitster@pobox.com>
Date
May 11, 2015, 17:45 UTC
Message-ID
<xmqqzj5bdn4w.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1431363819.15048.2.camel@ubuntu>
David Turner <dturner@twopensource.com> writes:
Show 21 quoted lines
> On Sun, 2015-05-10 at 09:06 +0200, Johannes Sixt wrote:
>> > +	ln -s loop2 loop1 &&
>> > +	git add . &&
>> > +	git commit -am "test"
>> > +'
>> 
>> These tests will fail on a file system that does not support symbolic 
>> links, such as on Windows. Would you please separate the test cases 
>> (that come after the setup) into two groups:
>> 
>> 1. Those that inspect the filesystem and expect a symbolic link. Protect 
>> these tests with a SYMLINKS prerequisite.
>
> I believe that none of these require that.
>
>> Note that you do not require a symlink enabled file system to generate a 
>> repository with symlinks, i.e., you don't have to protect the setup code 
>> with SYMLINKS. For this, you can use 'test_ln_s_add' instead of the 
>> above sequence of 'ln -s' followed by a single 'git add .'.
>
> Will fix, thanks.

Yeah, thanks. There doesn't seem to be any reason to forbid this new feature from being used on symlink-challenged filesystem (after all, "cat-file --batch" should run fine in a bare repository) and the suggestion makes sens to me.

Show 7 quoted lines
>> > +
>> > +echo $hello_sha1 blob $hello_size > found
>> 
>> This seems to be used only in the next test. Please move it inside 
>> test_expect_success.
>
> This is used in a number of tests, e.g this one:
Perhaps then the preparetion of 'found' is part of this thing:
    test_expect_success 'prep for symlink tests' '

A micronit on style; please drop SP between redirection and its target (but have one before redirection), i.e.

	echo ... >found
	command <input
Thanks.
Show 6 quoted lines
>
>> > +test_expect_success 'git cat-file --batch-check --follow-symlinks
>> > works for in-repo, same-dir links' '
>> > +	echo HEAD:same-dir-link | git cat-file --batch-check --follow-symlinks > actual &&
>> > +	test_cmp found actual
>> > +'
Previous: David TurnerNext: Junio C Hamano
Message 7 of 8 in “tree-walk: learn get_tree_entry_follow_symlinks”
  1. 1/3 tree-walk: learn get_tree_entry_follow_symlinksdturner@twopensource.com, May 9, 2015
  2. 2/3 sha1_name: get_sha1_with_context learns to follow symlinksdturner@twopensource.com, May 9, 2015
  3. Junio C HamanoMay 10, 2015
  4. 3/3 cat-file: add --follow-symlinks to --batchdturner@twopensource.com, May 9, 2015
  5. Johannes SixtMay 10, 2015
  6. David TurnerMay 11, 2015
  7. Junio C HamanoMay 11, 2015
  8. Junio C HamanoMay 10, 2015

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.