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

Re: [PATCH] tests: make all test files executable

From
Jeff King <peff@peff.net>
Date
Oct 2, 2009, 08:39 UTC
Message-ID
<20091002083946.GA8627@coredump.intra.peff.net>
In-Reply-To
<20091002080134.GD27664@coredump.intra.peff.net>
On Fri, Oct 02, 2009 at 04:01:34AM -0400, Jeff King wrote:
Show 14 quoted lines
> >  0 files changed, 0 insertions(+), 0 deletions(-)
> >  mode change 100644 => 100755 t/t5531-deep-submodule-push.sh
> >  mode change 100644 => 100755 t/t9501-gitweb-standalone-http-status.sh
> > 
> > diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
> > old mode 100644
> > new mode 100755
> > diff --git a/t/t9501-gitweb-standalone-http-status.sh
> > b/t/t9501-gitweb-standalone-http-status.sh
> > old mode 100644
> > new mode 100755
> 
> When applying via "am", I only got the first change in my tree. I'll see
> if I can confirm and make a test case.

Ah, nevermind. The problem is that your patch was word-wrapped, making the second "diff --git" line bogus. It would have been nice to have it print a warning instead of silently ignoring that bit of the patch.

I'm not sure if it is a good idea, though. git-apply sees that the "diff --git" line is there but can't get a filename from it. Which _should_ cause it to barf when we get to the mode lines. But we first see the wrapped filename and consider that patch section to be over (and the mode lines just become cruft at the end of the patch, which we must ignore).

And we must consider that patch section to be over when we see random text, because we need to jump back to the outer parser looking for more hunks. We could warn about a "diff --git" line that has no actual changes associated with it, though that is certainly a user-visible change. I also suspect it wouldn't help if there was a mode change followed by some actual content changes.

Hmph.
-Peff
Previous: Jeff KingNext: Mark Rada
Message 3 of 7 in “tests: make all test files executable”
  1. tests: make all test files executableMark Rada, Oct 2, 2009
  2. Jeff KingOct 2, 2009
  3. Jeff KingOct 2, 2009
  4. Mark RadaOct 4, 2009
  5. Jeff KingOct 4, 2009
  6. Mark RadaOct 5, 2009
  7. Jeff KingOct 5, 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.