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

Re: git log -z doesn't separate commits with NULs

From
NSNikolaj Shurkaev <snnicky@gmail.com>
Date
Feb 24, 2012, 09:21 UTC
Message-ID
<4F475689.4040203@gmail.com>
In-Reply-To
<7vy5rt2u0c.fsf@alter.siamese.dyndns.org>
Hello.
Thank you for the hint.
git format-patch HEAD~3..HEAD -- SomePath

does exactly what I need. But that way of usage is not described in git documentation thus I thought there is no way to do that. I've just double checked

git format-patch --help

doesn't describe that. I'll propose to put something like this into git documentation --------------------------------------------------------------------------------------------

diff --git a/Documentation/git-format-patch.txt 
b/Documentation/git-format-patch.txt
index 6ea9be7..63267c6 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -23,6 +23,7 @@ SYNOPSIS
[--cover-letter] [--quiet]
[<common diff options>]
[ <since> | <revision range> ]
+ [[\--] <path>...]

DESCRIPTION
-----------
@@ -219,6 +220,12 @@ you can use `--suffix=-patch` to get 
`0001-description-of-my-change-patch`.
range are always formatted as creation patches, independently
of this flag.

+[\--] <path>...::
+ Put in patches only those modifications that affect specified files
+ and folders. It's important to understand that log message of the
+ commit may become inappropriate because some parts of patch may be
+ cut off.
+
CONFIGURATION
-------------
You can specify extra mail header lines to be added to each message,
--------------------------------------------------------------------------------------------

--
Nikolaj.

23.02.2012 23:07, Junio C Hamano пишет:
> Jeff King<peff@peff.net>  writes:
>
>> On Thu, Feb 23, 2012 at 04:48:43PM +0300, Nikolaj Shurkaev wrote:
>>
>> Doesn't:
>>
>>    git format-patch HEAD~3..HEAD SomePath
>>
>> do what you want? It is certainly designed to, and it seems to work for
>> me.
> It is not quite "designed to", though.
>
> It happens to work that way, and I do not think we want to forbid its use,
> but we would want to discourage anybody from blindly using it without
> thinking if the end results suits his/her purpose (and the reason should
> be obvious to those who think, the hint is "log message").
>
Previous: Junio C HamanoNext: Jeff King
Message 12 of 22 in “git log -z doesn't separate commits with NULs”
  1. Nikolaj ShurkaevFeb 23, 2012
  2. Luke DiamandFeb 23, 2012
  3. Jeff KingFeb 23, 2012
  4. Johannes SixtFeb 23, 2012
  5. Nikolaj ShurkaevFeb 23, 2012
  6. Jeff KingFeb 23, 2012
  7. Nikolaj ShurkaevFeb 23, 2012
  8. Jakub NarebskiFeb 23, 2012
  9. Nikolaj ShurkaevFeb 23, 2012
  10. Jeff KingFeb 23, 2012
  11. Junio C HamanoFeb 23, 2012
  12. Nikolaj ShurkaevFeb 24, 2012
  13. Jeff KingFeb 24, 2012
  14. Junio C HamanoFeb 24, 2012
  15. Jeff KingFeb 24, 2012
  16. Junio C HamanoFeb 24, 2012
  17. Jeff KingFeb 24, 2012
  18. Nikolaj ShurkaevMar 3, 2012
  19. Jakub NarebskiFeb 24, 2012
  20. Junio C HamanoFeb 24, 2012
  21. Andreas SchwabFeb 23, 2012
  22. Nikolaj ShurkaevFeb 23, 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.