[libvirt] need help/clarification about git and patches.

Using git is more than a little different way of doing business for me. My usual way to create and apply a patch is to rebuild a src.rpm. This way I have a lot less changes of screwing something up because of ignorance. It it a little while but I finally cloned a copy of libvirt.git. I applied a patch to remove the "--filterwin2k" [one fixup because a test file changed slightly. I then ran "git diff" and produce a new patch. OK, now what? I did the "git commit" and then tried to do the "git send-email" like it says in your "hacking" document ... "git: 'send-email' is not a git command. I am going to do what I believe is the right thing to do and submit the patch but there needs to be a bit more info as to how we should do things. Gene

On 09/06/2012 09:59 AM, Gene Czarcinski wrote:
Using git is more than a little different way of doing business for me. My usual way to create and apply a patch is to rebuild a src.rpm. This way I have a lot less changes of screwing something up because of ignorance.
It it a little while but I finally cloned a copy of libvirt.git. I applied a patch to remove the "--filterwin2k" [one fixup because a test file changed slightly. I then ran "git diff" and produce a new patch.
Seems reasonable. If the instructions in HACKING could use an improvement, let us know what we can do to make it better.
OK, now what? I did the "git commit" and then tried to do the "git send-email" like it says in your "hacking" document ... "git: 'send-email' is not a git command.
Ah, that's because 'git send-email' is not packaged with 'git' in Fedora. You want to also install the 'git-email' package. (Why it isn't shipped as part of the core git package is beyond me, but I'm not the package maintainer.)
I am going to do what I believe is the right thing to do and submit the patch but there needs to be a bit more info as to how we should do things.
Feel free to ask questions like this. Sounds like our HACKING should mention the 'git-email' package on Fedora, for starters. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Sep 06, 2012 at 11:59:10AM -0400, Gene Czarcinski wrote:
Using git is more than a little different way of doing business for me. My usual way to create and apply a patch is to rebuild a src.rpm. This way I have a lot less changes of screwing something up because of ignorance.
It it a little while but I finally cloned a copy of libvirt.git. I applied a patch to remove the "--filterwin2k" [one fixup because a test file changed slightly. I then ran "git diff" and produce a new patch.
OK, now what? I did the "git commit" and then tried to do the "git send-email" like it says in your "hacking" document ... "git: 'send-email' is not a git command.
Slightly annoyingly, the 'send-email' command requires that you have installed the 'git-email' RPM too. One other tip the first time you try 'git send-email' is to test it using your own private email address, rather than the mailing list address :-)
I am going to do what I believe is the right thing to do and submit the patch but there needs to be a bit more info as to how we should do things.
Yep, once you get used to its way of working, I'm sure you'll find using GIT a nicer approach than patching the RPMs each tine. FYI in case you don't already know, you can also run libvirt builds directly from the source tree, rather than needing to run 'make intsall' or install an updated RPM every time. my usual way of working is to just stop the libvirtd process fro mthe RPM and then run $ cd $LIBVIRT_GIT $ ./autogen.sh --system $ make $ su - # ./daemon/libvirtd You can also run ./tools/virsh, and if you want to test external apps with the libvirt client / python bindings you can set: export LD_LIBRARY_PATH=$LIBVIRT_GIT/src/.libs export PYTHONPATH=$LIBVIRT_GIT/python:$LIBVIRT_GIT/python/.libs Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 09/06/2012 12:53 PM, Daniel P. Berrange wrote:
FYI in case you don't already know, you can also run libvirt builds directly from the source tree, rather than needing to run 'make intsall' or install an updated RPM every time. my usual way of working is to just stop the libvirtd process fro mthe RPM and then run
$ cd $LIBVIRT_GIT $ ./autogen.sh --system $ make $ su - # ./daemon/libvirtd
There is one small difference to running it this way rather than as a system service - it will be running in an unconfined/unrestricted state, so some things that may have otherwise failed due to a lack of permission, will succeed. So if you've changed anything related to what external programs are called, or what files/devices are accessed, it's usually a good idea to make a final test with a proper install (I tend to do that by running "make rpm" followed by an install of the rpms - there are yet other problems that don't show up if you simply run "make install"...)

On 09/06/2012 11:59 AM, Gene Czarcinski wrote:
Using git is more than a little different way of doing business for me. My usual way to create and apply a patch is to rebuild a src.rpm. This way I have a lot less changes of screwing something up because of ignorance.
My experience is the opposite - I usually end up screwing something up if I try to mess with a src.rpm :-)
It it a little while but I finally cloned a copy of libvirt.git. I applied a patch to remove the "--filterwin2k" [one fixup because a test file changed slightly. I then ran "git diff" and produce a new patch.
OK, now what? I did the "git commit" and then tried to do the "git send-email" like it says in your "hacking" document ... "git: 'send-email' is not a git command.
On Fedora and RHEL (I'm not sure about other platforms) git's "send-email" subcommand is in a sub-package of git called "git-email". See if your distro's package system can install a package with that name.
I am going to do what I believe is the right thing to do and submit the patch but there needs to be a bit more info as to how we should do things.
A note pointing out that the git-email package also needs to be installed is a good idea. I've just sent a patch to libvir-list that adds that (and while I was touching the file, made it more insistent that people run "make check" and "make syntax-check" :-))

Rather than cluttering up the mailing list, I am going to combine the helpful replies into a single response. I am going to edit this to reduce clutter. On 09/06/2012 01:26 PM, Laine Stump wrote:
On 09/06/2012 11:59 AM, Gene Czarcinski wrote:
Using git is more than a little different way of doing business for me. My usual way to create and apply a patch is to rebuild a src.rpm. This way I have a lot less changes of screwing something up because of ignorance. My experience is the opposite - I usually end up screwing something up if I try to mess with a src.rpm :-)
When you are deep into working on a large project such as libvirt, git is the way to go. If you are just trying to create a small bugfix, then rpm can take care of all the extra stuff so that you get code that will work. Besides, after working with rpm for over 15 years, you get comfortable with its ways. <snip>
On Fedora and RHEL (I'm not sure about other platforms) git's "send-email" subcommand is in a sub-package of git called "git-email". See if your distro's package system can install a package with that name. I do not remember actually selecting the git package ... but, in the future, I will remember that I will also need the git-mail package.
I do suggest that the "hacking" get updated with this info. On 09/06/2012 12:53 PM, Daniel P. Berrange wrote:
One other tip the first time you try 'git send-email' is to test it using your own private email address, rather than the mailing list address :-) Oh yes, this is definitely something to do! I suggest this also be added to the "hacking" document.
On 09/06/2012 12:31 PM, Eric Blake wrote:
Seems reasonable. If the instructions in HACKING could use an improvement, let us know what we can do to make it better.
One other minor detail. It you have been using git for a while, what the "hacking" document says makes sense ... but it is not quite complete. I realize that this document is about libvirt hacking and not a user's manual for git, but a little more info would be extremely useful. Something like the following: 0. If on Fedora or RHEL, install the git-mail package. 1. create a directory such as "git-dev" where you will have the repositories and then "cd" to that directory. 2. Do: "git init" "git --global user.email "me@here.com" "git --global user.name "Your Name" "git clone git://libvirt.org/libvirt.git" [That last one was "interesting" because I had no idea where it was] Note: To use the "git send-email ...", you will likely need to set a number of options such as "git config sendemail.to me@here.com" Thanks for your patience. Gene
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Gene Czarcinski
-
Laine Stump