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

Re: [PATCH 1/2] t3310: Add testcase demonstrating failure to --commit from within another dir

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2012, 18:21 UTC
Message-ID
<7vr4wxsmrt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1331564233-1969-1-git-send-email-johan@herland.net>
Johan Herland <johan@herland.net> writes:
> Found-by: David Bremner <david@tethera.net>
> Signed-off-by: Johan Herland <johan@herland.net>
Could you clarify what "from within another dir" means on the subject?
What was the expected usage?
	The 'git notes merge' command expected to be run from the
        working tree of the project being annotated, and did not
        anticipate getting run inside $GIT_DIR/.  However, because
        we use $GIT_DIR/NOTES_MERGE_WORKTREE as a temporary working
        space for the user to work on resolving conflicts, it is not
        unreasonable for a user to run "git notes merge --commit"
        there.
Is that the issue?
Show 46 quoted lines
> ---
>
> (sending again in the correct thread. Sorry for the screwup.)
>
> This is a transcription of David's test script into a git test case.
>
> Thanks to David for finding this issue.
>
>
> Have fun! :)
>
> ...Johan
>
>  t/t3310-notes-merge-manual-resolve.sh |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh
> index 4367197..0c531c3 100755
> --- a/t/t3310-notes-merge-manual-resolve.sh
> +++ b/t/t3310-notes-merge-manual-resolve.sh
> @@ -553,4 +553,23 @@ test_expect_success 'resolve situation by aborting the notes merge' '
>  	verify_notes z
>  '
>
> +cat >expect_notes <<EOF
> +foo
> +bar
> +EOF
> +
> +test_expect_failure 'switch cwd before committing notes merge' '
> +	git notes add -m foo HEAD &&
> +	git notes --ref=other add -m bar HEAD &&
> +	test_must_fail git notes merge refs/notes/other &&
> +	(
> +		cd .git/NOTES_MERGE_WORKTREE &&
> +		echo "foo" > $(git rev-parse HEAD) &&
> +		echo "bar" >> $(git rev-parse HEAD) &&
> +		git notes merge --commit
> +	) &&
> +	git notes show HEAD > actual_notes &&
> +	test_cmp expect_notes actual_notes
> +'
> +
>  test_done
> --
> 1.7.9.2
Previous: Johan HerlandNext: Johan Herland
Message 5 of 6 in “problem with merging notes.”
  1. David BremnerMar 11, 2012
  2. Michael SchubertMar 11, 2012
  3. 1/2 t3310: Add testcase demonstrating failure to --commit from within another dirJohan Herland, Mar 12, 2012
  4. 2/2 notes-merge: use opendir/readdir instead of using read_directory()Johan Herland, Mar 12, 2012
  5. Junio C HamanoMar 12, 2012
  6. Johan HerlandMar 12, 2012

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.