I basically have 3 questions:
- Which is better to use and why? git format-patch or git bundle?
- What all metadata is used by GIT to calculate SHA-1 key for commit and blobs/trees?
- When I apply a patch which was created by format-patch, why does it have different SHA for same changes and commit?
this obviously depends on your use-case;
git bundle
only makes sense if you transfer a changeset from one git-repository to another, whereasgit format-patch
creates standard diff-files which can be inspected easily and applied to a non-gitified source tree as well. on the other handgit bundle
creates a single file, which is easier to transport than the multi-file output ofgit format-patch
this is possibly a duplicate of Is SHA-1 calculated based on content?
see #2