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

Re: [PATCH] t4202 (log): add test for --follow over a merge

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 23, 2013, 06:28 UTC
Message-ID
<20130423062821.GA32683@elie.Belkin>
In-Reply-To
<1366643912-3942-1-git-send-email-artagnon@gmail.com>
Hi,
Ramkumar Ramachandra wrote:
> The --follow feature can be used to follow the history of a file over
> a merge commit, and is useful even when the file hasn't been
> copied/renamed.  Add a test to show off this feature.

I can't claim to have followed the discussion, but I don't understand the above. If the file's name hasn't changed, the most one can hope for is that --follow doesn't hurt, no?

[...]
Show 8 quoted lines
> +	cat >expect <<-\EOF &&
> +	df26551 add a line to the beginning of ichi
> +	882d8d9 add a line to the end of ichi
> +	2fbe8c0 third
> +	f7dab8e second
> +	3a2fdcb initial
> +	EOF
> +	test_cmp expect actual
t/README explains:
| As with any programming projects, existing programs are the best
| source of the information.  However, do _not_ emulate
| t0000-basic.sh when writing your tests.  The test is special in
| that it tries to validate the very core of GIT.
[...]
|          other tests that simply rely on basic parts of the core
| GIT working properly should not have that level of intimate
| knowledge of the core GIT internals.  If all the test scripts
| hardcoded the object IDs like t0000-basic.sh does, that defeats
| the purpose of t0000-basic.sh, which is to isolate that level of
| validation in one place.

Hard-coding object names makes it painful to tweak a given test and tests that come before it, lest a timestamp or the phase of moon change and cause the object names to drift. Don't do it, except in t0000.

Hope that helps, Jonathan

Previous: Ramkumar Ramachandra
Message 2 of 2 in “t4202 (log): add test for --follow over a merge”
  1. t4202 (log): add test for --follow over a mergeRamkumar Ramachandra, Apr 22, 2013
  2. Jonathan NiederApr 23, 2013

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.