[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-vc-dwim] bug#21120: vc-chlog fails if git submodules are dirty
From: |
Assaf Gordon |
Subject: |
[Bug-vc-dwim] bug#21120: vc-chlog fails if git submodules are dirty |
Date: |
Wed, 22 Jul 2015 19:54:47 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Hello,
it seems that if a project using git has a submodule that is dirty, vc-chlog
will fail to print the information about all the files.
To reproduce:
====
git clone git://git.sv.gnu.org/hello.git
cd hello/
./bootstrap
echo >> bootstrap.conf
echo >> gnulib/cfg.mk
echo >> src/hello.c
====
The diff looks like this:
===
$ git diff
diff --git a/bootstrap.conf b/bootstrap.conf
index 9e6b005..79d4c5b 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -119,3 +119,4 @@ bootstrap_epilogue()
done
fi
}
+
diff --git a/gnulib b/gnulib
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d
+Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d-dirty
diff --git a/src/hello.c b/src/hello.c
index 8e6cfbd..f0d12de 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -187,3 +187,4 @@ License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\n\
This is free software: you are free to change and redistribute it.\n\
There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
}
+
===
But vc-chlog will stop after the gnulib submodule:
===
$ vc-chlog
2015-07-22 gordon <address@hidden>
* bootstrap.conf:
* gnulib:
===
A bit of debugging seems to show that in 'vc-chlog', the output of
'processed-diff()' is:
bootstrap.conf 1 3 9 0-0-122-122
gnulib 1 11 15 1-1-1-1
src/hello.c 1 18 24 0-0-190-190
Then 'func_extract_identifiers()' calls 'func_apply_tmp_patch()' which runs
'patch', and patch fails.
One possible work-around is to ignore submodules in 'vc-dwim' (attached patch).
Another possible thing is to make 'vc-dwim' abort if there are dirty
submodules, on the assumption that 'vc-dwim' is meant to prevent problematic
commits, and a dirty submodule is a hint of a potential problem.
related to this approach, there was a discussion couple of months about about
adding a server-side git hook in savannah to prevent such commits, but it was
decided against such forcible approach. perhaps warning about dirty submodules
in 'vc-dwim' is more polite?
http://lists.gnu.org/archive/html/coreutils/2015-04/msg00017.html
regards,
- assaf
vc-dwim-ignore-git-submodules.patch
Description: Text Data
- [Bug-vc-dwim] bug#21120: vc-chlog fails if git submodules are dirty,
Assaf Gordon <=