Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
2009/8/12 Johannes Schindelin : >> Yep, verified. Many thanks once again! I think this can be very useful >> for new contributors. > > I hope so. > > Maybe you tell me the most common operations, and I'll add the > functionality? Hmm, I'm probably not the right person to ask because I guess I'm not the kind of contributor this script is targeted at (I was just interested in how it works and in testing it :-P). Also, I usually prefer the flexibility of working from the command line. But I'm sure there are plenty of others who will have many suggestions! Cheers, Max ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Wed, 12 Aug 2009, Maximilian Albert wrote: > 2009/8/12 Johannes Schindelin : > > > Fixed and pushed. > > Yep, verified. Many thanks once again! I think this can be very useful > for new contributors. I hope so. Maybe you tell me the most common operations, and I'll add the functionality? Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
2009/8/12 Johannes Schindelin : > Fixed and pushed. Yep, verified. Many thanks once again! I think this can be very useful for new contributors. Max ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Wed, 12 Aug 2009, Maximilian Albert wrote: > 2009/8/11 Johannes Schindelin : > > > I actually had to change the --work-tree things, since it is utter > > garbage. I _know_ why I was opposed to its inclusion. > > > > [..] > > > > I added two shorter notices, and I also set the busy cursor now. > > Hehe, sorry for complaining again. But now the script aborts with an > error about the missing $lily_dir directory. When I manually create it, > the script starts and shows the "Update" button, but upon pressing the > button the script complains that the directory is not a git repository > (obviously ...). Fixed and pushed. Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
2009/8/11 Johannes Schindelin : > I actually had to change the --work-tree things, since it is utter > garbage. I _know_ why I was opposed to its inclusion. > > [..] > > I added two shorter notices, and I also set the busy cursor now. Hehe, sorry for complaining again. But now the script aborts with an error about the missing $lily_dir directory. When I manually create it, the script starts and shows the "Update" button, but upon pressing the button the script complains that the directory is not a git repository (obviously ...). Max ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Maximilian Albert wrote: > > I pushed a new version to git://repo.or.cz/lilypond/dscho.git. You > > can download it directly here: > > > > http://repo.or.cz/w/lilypond/dscho.git?a=blob_plain;f=lilycontrib.tcl;hb=lilycontrib > > Cool, works like a charm now. Thanks a lot! I actually had to change the --work-tree things, since it is utter garbage. I _know_ why I was opposed to its inclusion. > One minor comment: For new contributors with no experience in git (or > version control in general) it may seem as though nothing happens after > pressing the button. Thus I'd suggest to add two messages to indicate > that the process was started, along the lines of: > > ==> > proc update_lilypond {} { > global lily_dir > if {![file exists $lily_dir]} { > write_to_output "Starting to clone LilyPond repository (this > can take some time) ...\n" > file mkdir $lily_dir > git init > git config core.bare false > git remote add -t master \ > origin git://repo.or.cz/lilypond.git > git fetch --depth 1 > git reset --hard origin/master > git config branch.master.remote origin > git config branch.master.merge refs/heads/master > .update configure -text "Update LilyPond" > } else { > write_to_output "Starting to update LilyPond repository ...\n" > git fetch origin > git merge origin/master > } > write_to_output "Done.\n" > } > <== I added two shorter notices, and I also set the busy cursor now. Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi Johannes, > I pushed a new version to git://repo.or.cz/lilypond/dscho.git. You can > download it directly here: > > http://repo.or.cz/w/lilypond/dscho.git?a=blob_plain;f=lilycontrib.tcl;hb=lilycontrib Cool, works like a charm now. Thanks a lot! One minor comment: For new contributors with no experience in git (or version control in general) it may seem as though nothing happens after pressing the button. Thus I'd suggest to add two messages to indicate that the process was started, along the lines of: ==> proc update_lilypond {} { global lily_dir if {![file exists $lily_dir]} { write_to_output "Starting to clone LilyPond repository (this can take some time) ...\n" file mkdir $lily_dir git init git config core.bare false git remote add -t master \ origin git://repo.or.cz/lilypond.git git fetch --depth 1 git reset --hard origin/master git config branch.master.remote origin git config branch.master.merge refs/heads/master .update configure -text "Update LilyPond" } else { write_to_output "Starting to update LilyPond repository ...\n" git fetch origin git merge origin/master } write_to_output "Done.\n" } <== Cheers, Max ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Jonathan Kulp wrote: > On Tue, Aug 11, 2009 at 7:00 AM, Jonathan Kulp wrote: > > > On Tue, Aug 11, 2009 at 6:45 AM, Johannes Schindelin < > > johannes.schinde...@gmx.de> wrote: > > > >> > > >> > So it doesn't give an error, just a warning. But AFAIR I have seen this > >> > warning on my non-GUI-based checkouts, too, even though everything > >> > worked fine. BTW, my git version is 1.6.0.4 (the latest one that Ubuntu > >> > 9.04 has to offer). > >> > >> Ouch, I think I know what happened. Git used your _current_ working > >> directory as work tree. So you have some stray LilyPond files lying > >> around somewhere. > >> > >> > > Aha! That's why I found a bunch of lily files in my $HOME/bin/ directory! I > > found a lily/ directory inadvertently last night, and now that I look, > > there's the Documentation, ly, make, stepmake, etc. So the files did get > > downloaded, just not where expected. Easily fixed... > > > > > Success! > > I chose an amateurish brute-force method but it worked. Here's my revised > update_lilypond function: > > proc update_lilypond {} { >global lily_dir >if {![file exists $lily_dir]} { >file mkdir $lily_dir >cd $lily_dir ; git init >git config core.bare false >cd $lily_dir ; git remote add -t master \ >origin git://repo.or.cz/lilypond.git >cd $lily_dir ; git fetch --depth 1 >cd $lily_dir ; git checkout -b master origin/master >} else { >cd $lily_dir ; git pull >} > } > > It's possible that the first "cd $lily_dir" would suffice but I wanted to be > sure without having to experiment. I know that in some circumstances the > next lines of scripts or makefiles the succeeding lines are run in the > working dir rather than the target dir. > > Thanks for the cool script, Johannes. :) Heh. I did something similar, except I used --work-tree and therefore could do it in one place. However, I needed the "file mkdir", too, and I had to change the "git pull" to a "git fetch" and "git merge" combo. This is something I wanted to do anyway, as I want to have a checkbox that says whether you want to rebase all the time, or rather merge. It probably should use the 'branch..rebase' config variable, just like Git does itself. Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Jonathan Kulp wrote: > On Tue, Aug 11, 2009 at 6:45 AM, Johannes Schindelin < > johannes.schinde...@gmx.de> wrote: > > > > > > > So it doesn't give an error, just a warning. But AFAIR I have seen > > > this warning on my non-GUI-based checkouts, too, even though > > > everything worked fine. BTW, my git version is 1.6.0.4 (the latest > > > one that Ubuntu 9.04 has to offer). > > > > Ouch, I think I know what happened. Git used your _current_ working > > directory as work tree. So you have some stray LilyPond files lying > > around somewhere. > > > > > Aha! That's why I found a bunch of lily files in my $HOME/bin/ > directory! I found a lily/ directory inadvertently last night, and now > that I look, there's the Documentation, ly, make, stepmake, etc. So the > files did get downloaded, just not where expected. Easily fixed... Well, not as easily as I thought: git pull does not like the "work-tree" option. But it is fixed in the current lilycontrib script. Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Jonathan Kulp wrote: > On Tue, Aug 11, 2009 at 4:12 AM, Maximilian Albert < > maximilian.alb...@googlemail.com> wrote: > > > P.S.: It would be nice to let the script print a short message when > > it's finished so that the user know when to stop waiting. ;-) > > I had the same experience as Max when I tried it on Fedora 11. The only > thing in there was the .git/ directory. I like the button, though. :) I pushed a new version to git://repo.or.cz/lilypond/dscho.git. You can download it directly here: http://repo.or.cz/w/lilypond/dscho.git?a=blob_plain;f=lilycontrib.tcl;hb=lilycontrib Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
On Tue, Aug 11, 2009 at 7:00 AM, Jonathan Kulp wrote: > On Tue, Aug 11, 2009 at 6:45 AM, Johannes Schindelin < > johannes.schinde...@gmx.de> wrote: > >> > >> > So it doesn't give an error, just a warning. But AFAIR I have seen this >> > warning on my non-GUI-based checkouts, too, even though everything >> > worked fine. BTW, my git version is 1.6.0.4 (the latest one that Ubuntu >> > 9.04 has to offer). >> >> Ouch, I think I know what happened. Git used your _current_ working >> directory as work tree. So you have some stray LilyPond files lying >> around somewhere. >> >> > Aha! That's why I found a bunch of lily files in my $HOME/bin/ directory! I > found a lily/ directory inadvertently last night, and now that I look, > there's the Documentation, ly, make, stepmake, etc. So the files did get > downloaded, just not where expected. Easily fixed... > > Success! I chose an amateurish brute-force method but it worked. Here's my revised update_lilypond function: proc update_lilypond {} { global lily_dir if {![file exists $lily_dir]} { file mkdir $lily_dir cd $lily_dir ; git init git config core.bare false cd $lily_dir ; git remote add -t master \ origin git://repo.or.cz/lilypond.git cd $lily_dir ; git fetch --depth 1 cd $lily_dir ; git checkout -b master origin/master } else { cd $lily_dir ; git pull } } It's possible that the first "cd $lily_dir" would suffice but I wanted to be sure without having to experiment. I know that in some circumstances the next lines of scripts or makefiles the succeeding lines are run in the working dir rather than the target dir. Thanks for the cool script, Johannes. :) Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
On Tue, Aug 11, 2009 at 6:45 AM, Johannes Schindelin < johannes.schinde...@gmx.de> wrote: > > > > So it doesn't give an error, just a warning. But AFAIR I have seen this > > warning on my non-GUI-based checkouts, too, even though everything > > worked fine. BTW, my git version is 1.6.0.4 (the latest one that Ubuntu > > 9.04 has to offer). > > Ouch, I think I know what happened. Git used your _current_ working > directory as work tree. So you have some stray LilyPond files lying > around somewhere. > > Aha! That's why I found a bunch of lily files in my $HOME/bin/ directory! I found a lily/ directory inadvertently last night, and now that I look, there's the Documentation, ly, make, stepmake, etc. So the files did get downloaded, just not where expected. Easily fixed... Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Maximilian Albert wrote: > 2009/8/11 Johannes Schindelin : > > > It actually worked here, twice. > > > > But you have this wonderful output field in the GUI, what does it have to > > say? I imagine that it gave you some error message or some such (probably > > due to an older Git version that refuses to update the current 'master' > > branch -- which has no commit yet, though). > > Sorry, I should of course have posted the output in the first place: > > ==> > Initialized empty Git repository in /home/username/lilypond/.git/ > >From git://repo.or.cz/lilypond > * [new branch] master -> origin/master > warning: You appear to be on a branch yet to be born. > warning: Forcing checkout of origin/master. > Already on "master" > Branch master set up to track remote branch refs/remotes/origin/master. > <== > > So it doesn't give an error, just a warning. But AFAIR I have seen this > warning on my non-GUI-based checkouts, too, even though everything > worked fine. BTW, my git version is 1.6.0.4 (the latest one that Ubuntu > 9.04 has to offer). Ouch, I think I know what happened. Git used your _current_ working directory as work tree. So you have some stray LilyPond files lying around somewhere. > > So I would like to ask you two things: first, what was the error message > > (there must have been one), and second: could you change the > > > > git checkout -b master origin/master > > > > to > > > > git reset --hard origin/master > > git config branch.master.remote origin > > git config branch.master.merge refs/heads/master > > > > ? > > Still no luck. :-( The warning is gone, but the result is as before > (directory is empty, 'git status' reports deleted files). Here is the > output of the new script: > > ==> > Initialized empty Git repository in /home/username/lilypond/.git/ > >From git://repo.or.cz/lilypond > * [new branch] master -> origin/master > HEAD is now at 00c6cac Nitpick: ly:spanner-bound grob name slur -> spanner. > <== I do not know why it worked here, but you may need to add the command line option --work-tree=$lily_dir/.. in the "git" function. > P.S.: It would be nice to let the script print a short message when > it's finished so that the user know when to stop waiting. ;-) Heh. You can easily add that by refactoring the write_to_output function thusly: proc write_to_output {string} { .output.text insert insert $string .output.text see end } proc write_file_to_output {f} { if {[eof $f]} { global git_command fconfigure $f -blocking true if {[catch {close $f} err]} { tk_messageBox -type ok -message "Git aborted: $err" } unset git_command } else { write_to_output [read $f 24] } } You need to replace the callback with write_file_to_output, of course, and at the end of the Git commands, you can say write_to_output "Done." Ciao, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
On Tue, Aug 11, 2009 at 4:12 AM, Maximilian Albert < maximilian.alb...@googlemail.com> wrote: > 2009/8/11 Johannes Schindelin : > > > It actually worked here, twice. > > > > But you have this wonderful output field in the GUI, what does it have to > > say? I imagine that it gave you some error message or some such (probably > > due to an older Git version that refuses to update the current 'master' > > branch -- which has no commit yet, though). > > Sorry, I should of course have posted the output in the first place: > > ==> > Initialized empty Git repository in /home/username/lilypond/.git/ > From git://repo.or.cz/lilypond > * [new branch] master -> origin/master > warning: You appear to be on a branch yet to be born. > warning: Forcing checkout of origin/master. > Already on "master" > Branch master set up to track remote branch refs/remotes/origin/master. > <== > > So it doesn't give an error, just a warning. But AFAIR I have seen > this warning on my non-GUI-based checkouts, too, even though > everything worked fine. BTW, my git version is 1.6.0.4 (the latest one > that Ubuntu 9.04 has to offer). > > > So I would like to ask you two things: first, what was the error message > > (there must have been one), and second: could you change the > > > >git checkout -b master origin/master > > > > to > > > >git reset --hard origin/master > >git config branch.master.remote origin > >git config branch.master.merge refs/heads/master > > > > ? > > Still no luck. :-( The warning is gone, but the result is as before > (directory is empty, 'git status' reports deleted files). Here is the > output of the new script: > > ==> > Initialized empty Git repository in /home/username/lilypond/.git/ > From git://repo.or.cz/lilypond > * [new branch] master -> origin/master > HEAD is now at 00c6cac Nitpick: ly:spanner-bound grob name slur -> spanner. > <== > > Thanks for your help, > Max > > P.S.: It would be nice to let the script print a short message when > it's finished so that the user know when to stop waiting. ;-) > > > I had the same experience as Max when I tried it on Fedora 11. The only thing in there was the .git/ directory. I like the button, though. :) Jon -- Jonathan Kulp http://www.jonathankulp.com ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
2009/8/11 Johannes Schindelin : > It actually worked here, twice. > > But you have this wonderful output field in the GUI, what does it have to > say? I imagine that it gave you some error message or some such (probably > due to an older Git version that refuses to update the current 'master' > branch -- which has no commit yet, though). Sorry, I should of course have posted the output in the first place: ==> Initialized empty Git repository in /home/username/lilypond/.git/ >From git://repo.or.cz/lilypond * [new branch] master -> origin/master warning: You appear to be on a branch yet to be born. warning: Forcing checkout of origin/master. Already on "master" Branch master set up to track remote branch refs/remotes/origin/master. <== So it doesn't give an error, just a warning. But AFAIR I have seen this warning on my non-GUI-based checkouts, too, even though everything worked fine. BTW, my git version is 1.6.0.4 (the latest one that Ubuntu 9.04 has to offer). > So I would like to ask you two things: first, what was the error message > (there must have been one), and second: could you change the > > git checkout -b master origin/master > > to > > git reset --hard origin/master > git config branch.master.remote origin > git config branch.master.merge refs/heads/master > > ? Still no luck. :-( The warning is gone, but the result is as before (directory is empty, 'git status' reports deleted files). Here is the output of the new script: ==> Initialized empty Git repository in /home/username/lilypond/.git/ >From git://repo.or.cz/lilypond * [new branch] master -> origin/master HEAD is now at 00c6cac Nitpick: ly:spanner-bound grob name slur -> spanner. <== Thanks for your help, Max P.S.: It would be nice to let the script print a short message when it's finished so that the user know when to stop waiting. ;-) ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Hi, On Tue, 11 Aug 2009, Maximilian Albert wrote: > 2009/8/11 Johannes Schindelin : > > > It actually only gives you a "Clone/Update" button that makes sure > > that a local clone (hardcoded to $HOME/lilypond) is up-to-date, but at > > least it has a progress bar, and I verified that it works even on > > Windows (what with its ridiculous insistence to put everything into > > directories containing spaces). > > When I try that script, I end up with an "empty" directory (i.e., only > the .git subdirectory is present). Running "git status" says that all > the files in the source tree were deleted. I can thus recreate them by > running "git reset --hard HEAD". What's happening here? It actually worked here, twice. But you have this wonderful output field in the GUI, what does it have to say? I imagine that it gave you some error message or some such (probably due to an older Git version that refuses to update the current 'master' branch -- which has no commit yet, though). So I would like to ask you two things: first, what was the error message (there must have been one), and second: could you change the git checkout -b master origin/master to git reset --hard origin/master git config branch.master.remote origin git config branch.master.merge refs/heads/master ? Thanks, Dscho ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
2009/8/11 Johannes Schindelin : > Okay, I could not resist, so here is something more capable. Thanks for not being more resistable. :-) (And for giving a nice illustration how easy it actually is to write a quick hacked-up GUI - I guess that'll be useful to me on many occasions in the future). > It actually > only gives you a "Clone/Update" button that makes sure that a local clone > (hardcoded to $HOME/lilypond) is up-to-date, but at least it has a > progress bar, and I verified that it works even on Windows (what with its > ridiculous insistence to put everything into directories containing > spaces). When I try that script, I end up with an "empty" directory (i.e., only the .git subdirectory is present). Running "git status" says that all the files in the source tree were deleted. I can thus recreate them by running "git reset --hard HEAD". What's happening here? Thanks, Max ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel