[arch-dev-public] Who broke devtools? - extrapkg svn commit == fail
So, please have a look at the second block: if [ "$1" != "" ]; then svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel $1" > /dev/null if [ $? -ne 0 ]; then echo "Cancelled" exit 1 fi echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel $1\" message" else svn commit >/dev/null if [ $? -ne 0 ]; then echo "Cancelled" exit 1 fi echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel\" message" fi 1) Redirecting the commit command to /dev/null if an editor is going to be called is fail. extrapkg was hanging indefinitely and I was really wondering why. 2) The above is easy to fix, however, the "Commited with ..." message is incorrect. Furthermore, we should still include "upgpkg: ..." in the default commit message, that is missing in the second code path.
On Tue, Sep 22, 2009 at 11:20 AM, Thomas Bächler <thomas@archlinux.org> wrote:
So, please have a look at the second block:
if [ "$1" != "" ]; then svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel $1" > /dev/null if [ $? -ne 0 ]; then echo "Cancelled" exit 1 fi echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel $1\" message" else svn commit >/dev/null if [ $? -ne 0 ]; then echo "Cancelled" exit 1 fi echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel\" message" fi
1) Redirecting the commit command to /dev/null if an editor is going to be called is fail. extrapkg was hanging indefinitely and I was really wondering why. 2) The above is easy to fix, however, the "Commited with ..." message is incorrect. Furthermore, we should still include "upgpkg: ..." in the default commit message, that is missing in the second code path.
first commit after 0.7.0 :) http://projects.archlinux.org/?p=devtools.git;a=commitdiff;h=0a35566e2baeaf0...
Xavier schrieb:
2) The above is easy to fix, however, the "Commited with ..." message is incorrect. Furthermore, we should still include "upgpkg: ..." in the default commit message, that is missing in the second code path.
first commit after 0.7.0 :) http://projects.archlinux.org/?p=devtools.git;a=commitdiff;h=0a35566e2baeaf0...
Nice, what about my second point? Can we predefine a partial commit message that will need to be edited?
On Tue, Sep 22, 2009 at 5:06 AM, Thomas Bächler <thomas@archlinux.org> wrote:
Xavier schrieb:
2) The above is easy to fix, however, the "Commited with ..." message is incorrect. Furthermore, we should still include "upgpkg: ..." in the default commit message, that is missing in the second code path.
first commit after 0.7.0 :)
http://projects.archlinux.org/?p=devtools.git;a=commitdiff;h=0a35566e2baeaf0...
Nice, what about my second point? Can we predefine a partial commit message that will need to be edited?
I seemed to get overruled on that one. I know a lot of my commit messages are going to be more worthless than before because I'm just doing a version bump; at least before you got the version info in the commit message. -Dan
On Tue, Sep 22, 2009 at 2:09 PM, Dan McGee <dpmcgee@gmail.com> wrote:
Nice, what about my second point? Can we predefine a partial commit message that will need to be edited?
I seemed to get overruled on that one. I know a lot of my commit messages are going to be more worthless than before because I'm just doing a version bump; at least before you got the version info in the commit message.
From what I understood, other people opposed to a default commit message that you don't have to edit. Thomas is proposing to predefine a commit message that still need to be edited. This seems to be the ideal solution, but I don't know if it is possible.
I don't know svn, but reading the doc, this does not seem to be immediately possible. Either you use -m message or -f file and the external editor is not called, or you use them and the editor is called. I don't know if something like this would work : echo upgpkg: $pkgbase $pkgver-$pkgrel > /tmp/commit-log $EDITOR /tmp/commit-log svn commit -f /tmp/commit-log Please correct me if I am wrong or if I am missing something :)
Xavier a écrit :
On Tue, Sep 22, 2009 at 2:09 PM, Dan McGee <dpmcgee@gmail.com> wrote:
Nice, what about my second point? Can we predefine a partial commit message that will need to be edited?
I seemed to get overruled on that one. I know a lot of my commit messages are going to be more worthless than before because I'm just doing a version bump; at least before you got the version info in the commit message.
From what I understood, other people opposed to a default commit message that you don't have to edit. Thomas is proposing to predefine a commit message that still need to be edited. This seems to be the ideal solution, but I don't know if it is possible.
I don't know svn, but reading the doc, this does not seem to be immediately possible. Either you use -m message or -f file and the external editor is not called, or you use them and the editor is called.
I don't know if something like this would work : echo upgpkg: $pkgbase $pkgver-$pkgrel > /tmp/commit-log $EDITOR /tmp/commit-log svn commit -f /tmp/commit-log
Please correct me if I am wrong or if I am missing something :)
Personally I prefer the following approach. 1. When I change anything non-trivial (other than version bumping) in the PKGBUILD, install scriptlet or included files, I do an explicit "svn commit -m 'blabla'" in trunk before running archrelease (usually via commitpkg or one of the symlinks to it). 2. When committing a version bump or simply calling archrelease, there is no need to enforce a commit message other than the default one. The issue is to make sure devs/TUs don't run commitpkg after having made a non-trivial change in trunk. ... Now what about this: modify commitpkg and archrelease so that if the output of $(svn diff) in trunk is not empty, the script will exit with a message saying 'please commit your changes in trunk with svn commit -m "some message"'. I would then remove the whole section with "svn commit" from commitpkg ;) Does that make any sense? If yes I have a patch ready... F
On Tue, Sep 22, 2009 at 8:12 AM, Xavier <shiningxc@gmail.com> wrote:
I don't know if something like this would work : echo upgpkg: $pkgbase $pkgver-$pkgrel > /tmp/commit-log $EDITOR /tmp/commit-log svn commit -f /tmp/commit-log
This would work, assuming all the error handling is in place (i.e. ensure editor can be called, if undefined, use vi by default, ensure return value before committing, ensure non-zero length commit message). The point of this whole commit is that our commit messages suck hard and are completely useless. This is largely due to laziness because it's all automated. The above would work fine for me, as it will help a wee bit, but we'll still be back into laziness territory. Also, for the record, I expected someone to yell about that commit before it was actually made into a release, but no one did :)
Aaron Griffin schrieb:
This would work, assuming all the error handling is in place (i.e. ensure editor can be called, if undefined, use vi by default, ensure return value before committing, ensure non-zero length commit message).
What about the simple way: if [ -z "$1" ]; then echo "Please ..." exit 1 done This way, the editor code path could be removed again. If someone wants a more complex commit message, take Francois' aproach and svn commit manually before calling XXXpkg. A simple commit message can be given on the command line and doesn't need a separate editor.
On Tue, Sep 22, 2009 at 11:51 AM, Thomas Bächler <thomas@archlinux.org> wrote:
Aaron Griffin schrieb:
This would work, assuming all the error handling is in place (i.e. ensure editor can be called, if undefined, use vi by default, ensure return value before committing, ensure non-zero length commit message).
What about the simple way:
if [ -z "$1" ]; then echo "Please ..." exit 1 done
This way, the editor code path could be removed again.
If someone wants a more complex commit message, take Francois' aproach and svn commit manually before calling XXXpkg.
A simple commit message can be given on the command line and doesn't need a separate editor.
Hmm that seems ok, but we should probably try and prevent things like: $ extrapkg " " via: ----- msg="$(echo $@)" if [ -z "$msg" ]; then echo "wtfdude?"; exit 1; fi sv commit -m "upgpkg: blah -> blah $msg" -----
Aaron Griffin schrieb:
What about the simple way:
if [ -z "$1" ]; then echo "Please ..." exit 1 done
This way, the editor code path could be removed again.
If someone wants a more complex commit message, take Francois' aproach and svn commit manually before calling XXXpkg.
A simple commit message can be given on the command line and doesn't need a separate editor.
Hmm that seems ok, but we should probably try and prevent things like: $ extrapkg " " via:
If someone wants to explicitly cheat the system, he will succeed anyway, so I wouldn't bother.
On Tue, Sep 22, 2009 at 12:31 PM, Thomas Bächler <thomas@archlinux.org> wrote:
Aaron Griffin schrieb:
What about the simple way:
if [ -z "$1" ]; then echo "Please ..." exit 1 done
This way, the editor code path could be removed again.
If someone wants a more complex commit message, take Francois' aproach and svn commit manually before calling XXXpkg.
A simple commit message can be given on the command line and doesn't need a separate editor.
Hmm that seems ok, but we should probably try and prevent things like: $ extrapkg " " via:
If someone wants to explicitly cheat the system, he will succeed anyway, so I wouldn't bother.
Considering this script lives on my machine and I've already hand-hacked it anyway, I'm with Thomas here. :) -Dan
On Tue, Sep 22, 2009 at 7:09 AM, Dan McGee <dpmcgee@gmail.com> wrote:
I seemed to get overruled on that one. I know a lot of my commit messages are going to be more worthless than before because I'm just doing a version bump; at least before you got the version info in the commit message.
That's an oversight more than anything else. See Xavier's steps below - we could have the best of both worlds
participants (5)
-
Aaron Griffin
-
Dan McGee
-
Firmicus
-
Thomas Bächler
-
Xavier