| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`git branch` is a porcelain command and should not be used in scripts.[^1]
It can also cause failures when:
- color.ui in git config is set to 'always'
- HEAD is detached (i.e. `git checkout blead^0`)
In that case the current branch is colored and (partially) ends up in
the `$branch` var. (The code did check that the branch name didn't start
with `(` but that check doesn't really work when it's colored. In that case
the 'branch name' starts with an escape sequence for the color)
Example (without the patch):
$ git config color.ui always
$ git checkout blead^0
$ ./miniperl -Ilib make_patchnum.pl
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git config branch.(detached.merge'
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git config branch.(detached.remote'
$ grep git_branch lib/Config_git.pl
git_branch='(detached'
$ grep git_branch lib/Config_git.pl | cat -A
git_branch='^[[32m(detached'$
With the patch applied:
$ ./miniperl -Ilib make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl'
$ grep git_branch lib/Config_git.pl
git_branch=''
$ grep git_branch lib/Config_git.pl | cat -A
git_branch=''$
[^1]: See https://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html
which is a blog post from the git maintainer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running 'make_patchnum.pl' from a subdir then 'make_patchnum.pl'
failed to write a proper lib/Config_git.pl. That is: all values in it
were set to the empty string instead to the actual values.
Example:
$ cd perl5
$ mkdir foo && cd $foo
$ ../miniperl -I../lib ../make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl'
$ cat ../lib/Config_git.pl
######################################################################
# WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id=''
git_describe=''
git_branch=''
git_uncommitted_changes=''
git_commit_id_title=''
This got broken in commit 3f1788e11f2685299067ac0f8d3e4fd141a5b5cd which
added support for -Dmksymlink.
That commit basically assumed that the stating point was always '.' and
that the './.git' directory exist. Neither are true when the command is
run from inside a subdir.
The proper thing to do is to first find the `$root` directory and then
check if it's in -Dmksymlinks target dir. (Luckily all that code already
exists, we just need to move the -Dmksymlinks logic a bit down.)
With this change applied:
$ ../miniperl -I../lib ../make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl'
$ cat lib/Config_git.pl
######################################################################
# WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id='c589bf60082d119a14e11ef05a77fed6d36aba4b'
git_describe='v5.37.2-170-gc589bf6'
git_branch='bram/fix-make_patchnum-in-subdir'
git_uncommitted_changes='0'
git_commit_id_title='Commit id:'
git_commit_date='2022-08-16 15:49:38 +0200'
ENDOFGIT
Note:
- to build on Windows one must do a `cd win32` before building. This is how
I noticed the file was incorrect.
- I've tested running make_patchnum from:
* the root
* a subdir
* a '-Dmksymlinks' target dir
* a subdir inside a '-Dmksymlinks' target
(PS: I also fixed the indentation from tabs to 4 spaces)
|
|
|
|
|
|
|
| |
Normally, builds require either a .patch file or to be built out of git
when not a proper release. We can use git attributes to make a file
that will give partial information about the commit when an archive is
created. This allows downloads from github to build.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ideally you should be able to do
(Configure && make test) 2> /tmp/err
with /tmp/err being empty. This is not the case, and this commit
is a first step towards that goal.
The
fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
in Configure appears to be just a debugging aid; it's also a copy of the
code in Porting/timecheck.c, which people can always run if need-be.
hints/linux.sh appears to be looking for symbols in libdb.so; if the
library is stripped, this produces to stderr:
/bin/nm: /lib/libdb.so: no symbols
I've silenced it for now with a 2>/dev/null, but I'm not sure if the whole
test is flawed, since with no symbols, 'nm libdb.so | grep pthread' is a
no-op.
make_patchnum.pl, when running backticks, prints $? to stderr if it's
non-zero; since a similar print in the other branch is already commented
out, I assume its just left-over debugging.
|
|
|
|
|
| |
Add David Steinbrunner to AUTHORS.
Update pod issues database.
|
|
|
|
|
| |
These were all uncovered by the new Pod::Checker, not yet in core.
Fixing these will speed up debugging the new Checker.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A previous commit of mine, 9077509c9b9bc1871867a5fba4351b95c670298d,
tried to handle the case where the output of 'git branch' was
* (no branch)
blead
to stop it outputting a 'Use of uninitialized value' warning.
However, my "fix" broke in the case where multiple branches are listed
with the current not the first:
blead
* tmp1
tmp2
Hopefully this fixes it properly.
|
| |
|
| |
|
|
|
|
|
| |
This patch also make PERL_GIT_UNCOMMITTED_CHANGES useful and thus avoids
always adding the "*" to the 'perl -v' output.
|
| |
|
|
|
|
|
|
|
|
|
| |
The git that I have installed (Debian etch) doesn't support "git
config".
This causes nasty failure in make_patchnum.pl, where it gets a help
message from git, and then blindly interpolates that message into a
command that it passes to the shell for execution. The attached patch
fixes this.
|
|
|
|
|
|
|
|
|
|
|
|
| |
this fixes script to work when run from a target/build dir
created by Configure -Dmksymlinks.. It works properly when
building in the srcdir too.
Several git commands fail for me, I added $opt_v=1 to see,
and left them; they add ~15 lines of output to a build.
(A bit amended by rgs: made $opt_v dependent on a -v flag on
the command-line)
|
|
|
|
| |
Remove special-casing from all the makefiles that coped with it returning non-0.
|
|
|
|
|
| |
- ts=4 is evil
- use same settings as in everywhere else in the core sources
|
|
|
|
| |
previous patches
|
|
|
|
| |
instead
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|