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

Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Mar 9, 2009, 17:36 UTC
Message-ID
<wesyHaGNnlB5oyurcOVfszxul5Cz5GxJhdT6fDpND5VxH9x2-iHvHg@cipher.nrlssc.navy.mil>
In-Reply-To
<20090308144240.GA30794@coredump.intra.peff.net>
Jeff King wrote:
Show 13 quoted lines
> On Sat, Mar 07, 2009 at 03:30:51AM -0600, Chris Johnsen wrote:
> 
>> +test_expect_code 1 'cherry-pick an empty commit' '
>> +
>> +	git checkout master &&
>> +	git cherry-pick empty-branch
>> +
>> +'
> 
> Hmm. This test fails for me on FreeBSD. However, it seems to be related
> to a shell portability issue with the test suite. The extra newline
> inside the shell snippet seems to lose the last status. The following
> works fine for me with bash or dash:
Show 22 quoted lines
> With this minimal example, you can see that the problem is not some
> subtle bug in the test suite:
> 
> -- >8 --
> #!/bin/sh
> 
> eval 'false'
> echo status is $?
> eval 'false
> '
> echo status is $?
> eval 'false
> 
> '
> echo status is $?
> -- 8< --
> 
> generates:
> 
>   status is 1
>   status is 1
>   status is 0

Even /bin/sh (which is unfit for git consumption) on Solaris 7 produces non-zero for all three tests:

   status is 255
   status is 255
   status is 255

I set SHELL_PATH=/usr/xpg4/bin/sh aka ksh when compiling git which also handles your test correctly:

   status is 1
   status is 1
   status is 1
IRIX6.5 /bin/sh and /bin/ksh produce the correct results also.
-brandon
Previous: Jeff King
Message 21 of 21 in “builtin-revert.c: release index lock when cherry-picking an empty commit”
  1. builtin-revert.c: release index lock when cherry-picking an empty commitChris Johnsen, Mar 7, 2009
  2. Johannes SchindelinMar 7, 2009
  3. Chris JohnsenMar 7, 2009
  4. Johannes SchindelinMar 8, 2009
  5. Junio C HamanoMar 8, 2009
  6. Chris JohnsenMar 8, 2009
  7. Junio C HamanoMar 8, 2009
  8. Jeff KingMar 8, 2009
  9. Jeff KingMar 8, 2009
  10. Junio C HamanoMar 8, 2009
  11. Jeff KingMar 10, 2009
  12. Tomas CarneckyMar 10, 2009
  13. Tomas CarneckyMar 10, 2009
  14. Chris JohnsenMar 10, 2009
  15. Jeff KingMar 11, 2009
  16. Mike RalphsonMar 11, 2009
  17. Mike RalphsonMar 11, 2009
  18. Jeff KingMar 22, 2009
  19. Junio C HamanoMar 22, 2009
  20. Jeff KingMar 22, 2009
  21. Brandon CaseyMar 9, 2009

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.