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

format-patch and submodules

From
Christopher Dunn <cdunn2001@gmail.com>
Date
Jun 4, 2015, 23:20 UTC
Message-ID
<CAD2z=MAu1qrr9=wwBnOJZZ3JCJOsmFWi=gDgKMQKU3_P-01e3g@mail.gmail.com>
(Seen in git versions: 2.1.0 and 1.9.3 et al.)

$ git format-patch --stdout X^..X | git apply check - fatal: unrecognized input

This fails when the commit consists of nothing but a submodule change (as in 'git add submodule foo'), but it passes when a file change is added to the same commit.

There used to be a similar problem for empty commits, but that was fixed around git-1.8:

    http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link

Now, 'git format-patch' outputs nothing for an empty commit. I suppose that needs to be the behavior also when only submodules are changed, since in that case there is no 'diff' section from 'format-patch'.

Use-case: git-p4

Of course, we do not plan to add the submodule into Perforce, but we would like this particular command to behave the same whether there are other diffs or not.

~Christopher Dunn (cdunn2001)
Next: Jens Lehmann
Message 1 of 5 in “format-patch and submodules”
  1. Christopher DunnJun 4, 2015
  2. Jens LehmannJun 9, 2015
  3. Christopher DunnJun 10, 2015
  4. Luke DiamandJun 10, 2015
  5. Christopher DunnJun 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.