summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e30f778)
raw | patch | inline | side by side (parent: e30f778)
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Tue, 12 Oct 2010 01:38:42 +0000 (21:38 -0400) | ||
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Tue, 12 Oct 2010 01:38:42 +0000 (21:38 -0400) |
This commit allow to track branches from unusually-named remote refs and
makes possible using external remotes (other than origin) for snapshots.
makes possible using external remotes (other than origin) for snapshots.
tools/sfsnapshotgit | patch | blob | history |
diff --git a/tools/sfsnapshotgit b/tools/sfsnapshotgit
index e79dd5538eac0efa48f049aa0ee2b9460557b3ac..8bc19fce803c1f19af4688b84def5c73951ae664 100755 (executable)
--- a/tools/sfsnapshotgit
+++ b/tools/sfsnapshotgit
# Sometimes "make dist" can modify versioned files so we must reset first
git reset --hard
git clean -qfdx
-# Any branch used to create snapshots must already exist
+
+# Any branch used to create snapshots must already exist and be properly configured
git checkout "$HEAD"
-git fetch "$SFSNAP_ORIGIN"
-git reset --hard "$SFSNAP_ORIGIN"/"$HEAD"
-# Tags are important for git-describe
+
+# Get the remote tracking branch from config
+origin=$(git config branch.$HEAD.remote)
+ref=$(git config branch.$HEAD.merge |sed -e 's|^refs/heads/||')
+git fetch "$origin"
+git reset --hard "$origin/$ref"
+
+# Tags are important for git-describe, but take only the ones from the hard-coded origin
git fetch --tags "$SFSNAP_ORIGIN"
# Write our snapshot version string (similar to NP-VERSION-GEN) to "release"