Closed michael-o closed 3 years ago
Thank you for catching this! I just pushed the fix for it.
Something is fishy here:
# git log --pretty=oneline | head -1
2d3daf03549374b31c40a068c3e8a9ab71f426f9 Updated fix for Issue #37 plus added an additional error message clarification
root@bsd1srv:~/gitup (main %=)
# make clean
rm -f gitup.1 gitup.conf.5 gitup.full.bc gitup.full.ll gitup gitup.bc gitup.ll gitup.full gitup.debug gitup.o gitup.bco gitup.llo gitup.1.gz gitup.conf.5.gz gitup.1.cat.gz gitup.conf.5.cat.gz
root@bsd1srv:~/gitup (main %=)
# make
Warning: Object directory not changed from original /root/gitup
cc -O2 -pipe -DCONFIG_FILE_PATH=\"/usr/local/etc/gitup.conf\" -g -MD -MF.depend.gitup.o -MTgitup.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c gitup.c -o gitup.o
cc -O2 -pipe -DCONFIG_FILE_PATH=\"/usr/local/etc/gitup.conf\" -g -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -o gitup.full gitup.o -lssl -lz -lcrypto -lprivateucl
objcopy --only-keep-debug gitup.full gitup.debug
objcopy --strip-debug --add-gnu-debuglink=gitup.debug gitup.full gitup
sed -e "s,%%CONFIG_FILE_PATH%%,/usr/local/etc/gitup.conf,g" gitup.1.in > gitup.1
gzip -cn gitup.1 > gitup.1.gz
sed -e "s,%%CONFIG_FILE_PATH%%,/usr/local/etc/gitup.conf,g" gitup.conf.5.in > gitup.conf.5
gzip -cn gitup.conf.5 > gitup.conf.5.gz
root@bsd1srv:~/gitup (main %=)
# make install
install -s -o root -g wheel -m 555 gitup /gitup
install -o root -g wheel -m 444 gitup.debug /.debug/gitup.debug
install -o root -g wheel -m 444 gitup.1.gz /usr/share/man/man1/
install -o root -g wheel -m 444 gitup.conf.5.gz /usr/share/man/man5/
root@bsd1srv:~/gitup (main %=)
# /gitup stable
# Host: github.com
# Port: 443
# Repository: /freebsd/freebsd.git
# Target: /usr/src
# Have: c735bf1ae3874ce1e9cfa718b95aad628b91f030
# Want: c735bf1ae3874ce1e9cfa718b95aad628b91f030
# Branch: stable/12
root@bsd1srv:~/gitup (main %=)
# cat /usr/src/.gituprevision
stable/12:c735bf1ae
root@bsd1srv:~/gitup (main %=)
# rm /usr/src/.gituprevision
root@bsd1srv:~/gitup (main %=)
# /gitup stable
# Host: github.com
# Port: 443
# Repository: /freebsd/freebsd.git
# Target: /usr/src
# Have: c735bf1ae3874ce1e9cfa718b95aad628b91f030
# Want: c735bf1ae3874ce1e9cfa718b95aad628b91f030
# Branch: stable/12
root@bsd1srv:~/gitup (main %=)
# cat /usr/src/.gituprevision
cat: /usr/src/.gituprevision: No such file or directory
The same applies to -t
:
root@bsd1srv:~/gitup (main %=)
# /gitup stable -t release/12.2.0
# Host: github.com
# Port: 443
# Repository: /freebsd/freebsd.git
# Target: /usr/src
# Tag: release/12.2.0
# Have: c735bf1ae3874ce1e9cfa718b95aad628b91f030
# Want: 1d21fe9cea3f530b4cfca495632d5a1595a32270
# Branch: stable/12
# Action: pull
root@bsd1srv:~/gitup (main %=)
# cat /usr/src/.gituprevision
release/12.2.0:1d21fe9ce
root@bsd1srv:~/gitup (main %=)
# rm /usr/src/.gituprevision
root@bsd1srv:~/gitup (main %=)
# /gitup stable -t release/12.2.0
# Host: github.com
# Port: 443
# Repository: /freebsd/freebsd.git
# Target: /usr/src
# Tag: release/12.2.0
# Have: 1d21fe9cea3f530b4cfca495632d5a1595a32270
# Want: 1d21fe9cea3f530b4cfca495632d5a1595a32270
# Branch: stable/12
root@bsd1srv:~/gitup (main %=)
# cat /usr/src/.gituprevision
cat: /usr/src/.gituprevision: No such file or directory
It seems like when have == want
the file is not created.
Can you confirm this?
I just moved the .gituprevision code to the main procedure so it gets updated on every run where a want or a tag is known. How does it look now?
Works for me now. Thanks!
See:
I would expect
.gituprevision
to containrelease/12.2.0:1d21fe9ce
.