lilypond-devel
[Top][All Lists]
Advanced

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

Update lilygit.tcl (Issue 2092) (issue 5504092)


From: Carl . D . Sorensen
Subject: Update lilygit.tcl (Issue 2092) (issue 5504092)
Date: Thu, 29 Dec 2011 06:00:06 +0000

Reviewers: ,

Message:
Here's a stab at revising lily-git.tcl to facilitate patch pushing by
git novices.

Please review.

Thanks,

Carl


Description:
Update lilygit.tcl (Issue 2092)

Makes lilygit.tcl respect the environment variable $LILYPOND_GIT.
If $LILYPOND_GIT is unset, default of $HOME/lilypond-git will be used.

Also does all working on dev/local_working branch, instead of master

Adds a Push Patch button to push patch to staging.

Please review this at http://codereview.appspot.com/5504092/

Affected files:
  M scripts/auxiliar/lily-git.tcl


Index: scripts/auxiliar/lily-git.tcl
diff --git a/scripts/auxiliar/lily-git.tcl b/scripts/auxiliar/lily-git.tcl
index 6f16791313d94a5aa83bfe7742406c16fff93e37..46740b35cbee4a56768baa33d5162dde48bd6a2e 100755
--- a/scripts/auxiliar/lily-git.tcl
+++ b/scripts/auxiliar/lily-git.tcl
@@ -4,13 +4,15 @@
 # Copyright 2009--2011 by Johannes Schindelin and Carl Sorensen
 #

-set version 0.64
+set version 0.65

 # set to 1 to set up for translation, to 0 for other
 set translator 0

 # location of lilypond git
-set lily_dir $env(HOME)/lilypond-git
+if [catch {set lily_dir $env(LILYPOND_GIT)}] {
+  set lily_dir $env(HOME)/lilypond-git
+}

 if {$translator == 1} {
     set windowTitle \
@@ -24,7 +26,8 @@ if {$translator == 1} {
         "LilyPond Contributor's Git Interface version $version"
     set updateButtonText "1. Update source"
     set initializeButtonText "1. Get source"
-    set originHead "master"
+    set originHead "staging"
+    set workingBranch "dev/local_working"
     set rebase 1
 }
 package require Tk
@@ -215,6 +218,7 @@ proc update_lilypond {rebase} {
     global lily_dir
     global originHead
     global translator
+    global workingBranch
     . config -cursor watch
     if {![file exists $lily_dir]} {
         write_to_output "Cloning LilyPond (this can take some time) ...\n"
@@ -228,16 +232,22 @@ proc update_lilypond {rebase} {
         git reset --hard origin/$originHead
         git config branch.$originHead.remote origin
         git config branch.$originHead.merge refs/heads/$originHead
+        if {$workingBranch != ""} {
+          git branch -f $workingBranch
+          git checkout $workingBranch
+        }
         .buttons.commitFrame.commit configure -state normal
         .buttons.commitFrame.amend configure -state normal
         .buttons.update configure -text buttonUpdateText
         .buttons.patch configure -state normal
+        .buttons.push configure -state normal
         .buttons.panic configure -state normal
         toggle_rebase
     } else {
         write_to_output "Updating LilyPond...\n"
         git fetch origin
         if {$rebase} {
+            git checkout $workingBranch
             git rebase origin/$originHead
         } else {
             git merge origin/$originHead
@@ -267,6 +277,16 @@ proc make_patch_from_origin {rebase} {
     . config -cursor ""
 }

+
+proc push_patch_to_staging {} {
+    global workingBranch
+    global originHead
+
+    git checkout $workingBranch
+    git rebase $originHead
+    git push origin HEAD:$workingBranch
+}
+
 proc abort_changes {} {
     global abort_dir
     global originHead
@@ -396,6 +416,8 @@ button .buttons.update -text $updateButtonText \
     -command update_lilypond_with_rebase
 button .buttons.patch -text "3. Make patch set" \
     -command patch_from_origin
+button .buttons.push -text "4. Push patch to staging" \
+    -command push_to_staging
 toggle_rebase
 button .buttons.panic -text "Abort changes -- Reset to origin" \
     -command abort_changes -fg Blue -bg Red
@@ -406,6 +428,7 @@ if {![file exists $lily_dir]} {
     .buttons.commitFrame.commit configure -state disabled
     .buttons.commitFrame.amend configure -state disabled
     .buttons.patch configure -state disabled
+    .buttons.push configure -state disabled
     .buttons.panic configure -state disabled
 }

@@ -414,6 +437,7 @@ if {![file exists $lily_dir]} {
 pack .buttons.update -side left
 pack .buttons.commitFrame -side left
 pack .buttons.patch -side left
+pack .buttons.push -side left
 pack .buttons.spacer -side left
 pack .buttons.panic -side right






reply via email to

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