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

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 23, 2012, 13:15 UTC
Message-ID
<m34nuhelnf.fsf@localhost.localdomain>
In-Reply-To
<4F462E61.4020203@gmail.com>
Nikolaj Shurkaev <snnicky@gmail.com> writes:
Show 29 quoted lines
> Thank you very much for your tips. They really helped me. I was trying
> to create patches that would affect only some given files or
> folders. By this moment I have the following:
> 
> GeneratePatches.sh
> ---------------------
> #!/bin/bash
> #parameter 1 - <since>..<to>
> #parameter 2 - path to file
> git log -z --reverse --format=email --patch "$1" -- "$2" | xargs
> --null --max-args=1 ./CreatePatchFile.sh
> ---------------------
> 
> and CreatePatchFile.sh
> ---------------------
> #!/bin/bash
> 
> myPatchNumber=$(ls ./*-patch.patch 2>/dev/null | wc -l)
> let "myPatchNumber += 1"
> 
> patchFile="./"$(printf "%04d" $myPatchNumber)"-patch.patch"
> echo "$@" > "$patchFile"
> ---------------------
> 
> I call
> ./GeneratePatches.sh HEAD~3..HEAD SomePath
> and that produces something very similar to what I want.
> 
> Perhaps there is a better way to do that.
So what git-format-patch is lacking?
-- 
Jakub Narebski
Previous: Nikolaj ShurkaevNext: Nikolaj Shurkaev
Message 8 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.