Re: Salvaging borked project history
- From
- Mason <slash.tmp@free.fr>
- Date
- Feb 26, 2015, 11:54 UTC
- Message-ID
- <54EF098B.4080803@free.fr>
- In-Reply-To
- <xmqq7fv8to7e.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
> But I personally think "git am -3" may be easier to handle.
Thanks! At least now, I see the light at the end of the tunnel.
I fetched linux-stable.git inside our repo. I created ~300 patches using git format-patch -1 in a loop. I can now run 'git am --3way $IGNORE *.patch'
IGNORE is used to --exclude the directories I'm not interested in.
Note: it seems --exclude=arch/mips and --exclude=arch/mips/ are not sufficient, I need to write --exclude=arch/mips/* for git-apply to ignore changes to files inside arch/mips.
Is that expected behavior?
Another nit: if a patch contains only changes to files inside arch/mips then git-apply will create an "empty commit" (one with no diff). Is there an option to say "skip empty patches"?
One more thing: "regular" diff -q returns 0 when the files are identical, and 1 when they differ. It seems git diff -s does not have that behavior. Is that by design?
If there is no option to skip empty patches, I'm thinking I can script a fixup step to squash all empty commits. What do you think?
Regards.