[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"

From: Johannes Schindelin
Subject: Re: lilycontrib.tcl, was Re: the "r" in "git pull -r"
Date: Tue, 11 Aug 2009 13:45:13 +0200 (CEST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)


On Tue, 11 Aug 2009, Maximilian Albert wrote:

> 2009/8/11 Johannes Schindelin <address@hidden>:
> > 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://
>  * [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 (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://
>  * [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 

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."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]