1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

mkdist: create git-commit-id instead of .git/HEAD

.git/HEAD in elinks-0.12pre1.tar.gz broke git-import-orig in Debian's
git-buildpackage 0.4.33:

$ git init
Initialized empty Git repository in .git/
$ git-import-orig ~/src/elinks-seek/elinks-0.12pre1.tar.gz
Upstream version is 0.12pre1
Initial import of '/home/Kalle/src/elinks-seek/elinks-0.12pre1.tar.gz' ...
fatal: bad object HEAD
Traceback (most recent call last):
  File "/usr/bin/git-import-orig", line 243, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/git-import-orig", line 201, in main
    import_upstream_tree(repo, orig_dir, version, options.filters, verbose=not is_empty)
  File "/usr/bin/git-import-orig", line 65, in import_upstream_tree
    if replace_source_tree(repo, src_dir, filters, verbose=True):
  File "/var/lib/python-support/python2.5/gbp/git_utils.py", line 145, in replace_source_tree
    return not repo.is_clean()[0]
  File "/var/lib/python-support/python2.5/gbp/git_utils.py", line 78, in is_clean
    if out[0].startswith('#') and out[1].strip().startswith(clean_msg):
IndexError: list index out of range

So let's try with a "git-commit-id" file outside of .git/ instead.
I also considered ".git-commit-id" but that could give the impression
that Git itself reads the file for some purpose.
This commit is contained in:
Kalle Olavi Niemitalo 2008-07-01 02:50:27 +03:00 committed by Kalle Olavi Niemitalo
parent ac7d17352a
commit 9b7de0a039

View File

@ -107,7 +107,7 @@ tmpdir=$(mktemp -d -t elinks-dist-XXXXXXXX) || exit 1
git --git-dir="$GIT_DIR" archive --format=tar --prefix="elinks/" "$rev" |
(cd -- "$tmpdir" && tar -xf -)
mkdir -- "$tmpdir/elinks/.git"
printf "%s\n" "$commit" > "$tmpdir/elinks/.git/HEAD"
printf "%s\n" "$commit" > "$tmpdir/elinks/git-commit-id"
(set -e
cd -- "$tmpdir/elinks"