* git patch format with copy/rename + modify, and binary files
@ 2006-08-11 20:50 Brendan Cully
0 siblings, 0 replies; only message in thread
From: Brendan Cully @ 2006-08-11 20:50 UTC (permalink / raw
To: git
Hi,
While working on an external git patch importer, I noticed that git
patches can break silently when fed to vanilla patch. Take this hunk
from the git tree:
diff --git a/git-pull-script b/git-fetch-script
similarity index 89%
copy from git-pull-script
copy to git-fetch-script
index bd892c7..17f22af 100755
--- a/git-pull-script
+++ b/git-fetch-script
@@ -39,8 +39,3 @@ download_one "$merge_repo/$merge_name" "
echo "Getting object database"
download_objects "$merge_repo" "$(cat "$GIT_DIR"/MERGE_HEAD)"
-
-git-resolve-script \
- "$(cat "$GIT_DIR"/HEAD)" \
- "$(cat "$GIT_DIR"/MERGE_HEAD)" \
- "$merge_repo"
git-apply would presumably create git-fetch-script by copying
git-pull-script then deleting this hunk. Vanilla patch simply deletes
the hunk from git-pull-script. This seems bad. Is there any reason why
git diff shouldn't use
--- a/git-fetch-script
+++ b/git-fetch-script
instead?
On a related note, it'd be nice if the format allowed for some kind of
representation of binary data. I had a half-baked idea that it could
hold a line describing the encoding of the diff, eg
encoding base64
which could indicate that the diff should be decoded as base64 before
being applied. This could allow a patch to hold a binary file add, or
wrap a binary diff, though it doesn't specify what form such a diff
should take...
thoughts?
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-11 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-11 20:50 git patch format with copy/rename + modify, and binary files Brendan Cully
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).