1 README for archives2git
2 =======================
4 `archives2git` is intended to recreate a poor-man's history from the (release)
5 archives of a project. It is an sh script that commits the given file archives
6 to a Git repository as a series of commits; by default the commit (sub-)trees
7 will replicate the contents of their corresponding archive.
9 For the documentation see the examples below, then look inside the script.
16 cd git-repo # may be a subdir of the toplevel of a repo
17 GIT_AUTHOR_NAME="Firstname Lastname" GIT_AUTHOR_EMAIL=user@host \
18 ./archives2git ../oldproject-?.??.tar.gz
20 Some possible options:
23 --keep-filter 'test x.gitignore = x"$file"'
24 # keep (only) the .gitignore file
25 --keep-filter 'echo "$file" | grep -q -f $HOME/filepats'
26 --rename 'echo "${file%-*}"'
27 # suppress the version info from the root directory in the archive
29 # allow to add ignored files
30 --date 'LC_ALL=C date -r "$arch"'
31 # use the archive modification time as the author date (with GNU date)
32 --title 'echo "${arch##*/}"'
33 # do not include the path components in the commit title
35 # interactively edit each commit message
36 --gitfilter $'--subdirectory-filter\noldproject'
37 # keep only the files of the project in the root of the tree
38 --gitfilter $'--tree-filter\nmv oldproject/.* .; mv oldproject/* .'
39 # move the project's files out of their subdir (while keeping other files)
44 * Trailing newlines in file names are not supported.
51 * `aunpack` from link:http://www.nongnu.org/atool/[atool]