]> git.ipfire.org Git - thirdparty/git.git/commit - fast-import.c
fast-export: add a --show-original-ids option to show original names
authorElijah Newren <newren@gmail.com>
Fri, 16 Nov 2018 07:59:56 +0000 (23:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 17 Nov 2018 09:43:52 +0000 (18:43 +0900)
commita965bb31166d04f3e5c8f7a93569fb73f9a9d749
tree385913d97dba601ccc48903a5867bb54b92c5a60
parent25dd3e4889a41a1ee40fbf961209e55d208382f0
fast-export: add a --show-original-ids option to show original names

Knowing the original names (hashes) of commits can sometimes enable
post-filtering that would otherwise be difficult or impossible.  In
particular, the desire to rewrite commit messages which refer to other
prior commits (on top of whatever other filtering is being done) is
very difficult without knowing the original names of each commit.

In addition, knowing the original names (hashes) of blobs can allow
filtering by blob-id without requiring re-hashing the content of the
blob, and is thus useful as a small optimization.

Once we add original ids for both commits and blobs, we may as well
add them for tags too for completeness.  Perhaps someone will have a
use for them.

This commit teaches a new --show-original-ids option to fast-export
which will make it add a 'original-oid <hash>' line to blob, commits,
and tags.  It also teaches fast-import to parse (and ignore) such
lines.

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-export.txt
Documentation/git-fast-import.txt
builtin/fast-export.c
fast-import.c
t/t9350-fast-export.sh