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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For example there are commits that affect not only files in folder A but files in folder B, C and so on. If I do format-patch that will give me nice patches, but there are modifications of folders B, C and so on there. I do not know a way to generate patches via format-patch that affect only files in folder A.

This is why I wrote those scripts.

23.02.2012 16:15, Jakub Narebski пишет:
Nikolaj Shurkaev<snnicky@xxxxxxxxx>  writes:

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?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]