aboutsummaryrefslogtreecommitdiffstats
path: root/make-version.pl
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-08-10 23:41:37 +0200
committerMichael Mann <mmann78@netscape.net>2016-08-14 12:54:03 +0000
commit94c4329b8a0f64805e432af9ae89b7d624437a08 (patch)
tree95584dc4c76d1307b7addfd658cb6cfdf258283b /make-version.pl
parentf1dc6cb42ce6f90f4554647ac0e201c9c8edbb24 (diff)
make-version.pl: make it work with git worktrees
When using git worktrees, the .git file is a regular file pointing to the original git repository. Accept this case too. Also ignore the fact that the original repo could be a git-svn repo, that is very unlikely. Example workflow (requires git 2.5): # Assume work in progress in current tree. Goal is to quickly do a # fix in another branch and publish the changes without interfering # with the WIP and without marking all files out of date (which # slows down re-compilation). git worktree add /tmp/wireshark-2.2 master-2.2 pushd /tmp/wireshark-2.2 # go to temporary tree git cherry-pick -x COMMIT # backport the fix git review # submit for review popd # go back to original tree rm -rf /tmp/wireshark-2.2 && git worktree prune # cleanup # now continue working where you left work Change-Id: Iba3c723142d9cbd8b07e76647594b5699ecafc67 Reviewed-on: https://code.wireshark.org/review/17002 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'make-version.pl')
-rwxr-xr-xmake-version.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/make-version.pl b/make-version.pl
index ee49de53f6..f12f8bc590 100755
--- a/make-version.pl
+++ b/make-version.pl
@@ -137,7 +137,7 @@ sub read_repo_info {
$package_format = $version_pref{"pkg_format"};
}
- if (-d "$srcdir/.git" && ! -d "$srcdir/.git/svn") {
+ if (-e "$srcdir/.git" && ! -d "$srcdir/.git/svn") {
$info_source = "Command line (git)";
$version_pref{"git_client"} = 1;
} elsif (-d "$srcdir/.svn" or -d "$srcdir/../.svn") {
@@ -255,7 +255,7 @@ sub read_repo_info {
unlink($tortoise_file);
}
- if ($num_commits == 0 and -d "$srcdir/.git") {
+ if ($num_commits == 0 and -e "$srcdir/.git") {
# Try git...
eval {