Git development
 help / color / mirror / Atom feed
* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Alex Riesen @ 2009-09-21  9:43 UTC (permalink / raw)
  To: Jim Meyering; +Cc: git list
In-Reply-To: <871vm0k6jm.fsf@meyering.net>

On Mon, Sep 21, 2009 at 11:09, Jim Meyering <jim@meyering.net> wrote:
> However, if the use of [] is deliberate, because git still
> cares about portability to ancient SYSV versions of tr that
> require that notation, then let me know and I'll undo that part
> of the change and add a comment to that effect.

We have (had?) people trying to support Git on HP-UX and SunOS.
Do these count?

^ permalink raw reply

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Jim Meyering @ 2009-09-21 11:00 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git list
In-Reply-To: <81b0412b0909210243h58633509r7b427c69f62928fe@mail.gmail.com>

Alex Riesen wrote:
> On Mon, Sep 21, 2009 at 11:09, Jim Meyering <jim@meyering.net> wrote:
>> However, if the use of [] is deliberate, because git still
>> cares about portability to ancient SYSV versions of tr that
>> require that notation, then let me know and I'll undo that part
>> of the change and add a comment to that effect.
>
> We have (had?) people trying to support Git on HP-UX and SunOS.
> Do these count?

I had my doubts, but have just confirmed that Solaris 10's
/usr/bin/tr is still doing it the SYSV way:

    $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
    foo

There, you have to use /usr/xpg4/bin/tr to get the expected behavior:

    $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
    FOO

So you're right.  Thanks!
Here's an updated patch:

>From 4048a5b393fa5f35dfe8157e98a6ea475b0efb2d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 21 Sep 2009 10:58:02 +0200
Subject: [PATCH] pre-commit.sample: add comment re tr portability; fix grammar

Add a comment explaining why square brackets around a tr range
are not only ok, but actually required in this case.
Correct spelling and grammar.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 templates/hooks--pre-commit.sample |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index b11ad6a..128c8cc 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks--pre-commit.sample
@@ -14,15 +14,18 @@ allownonascii=$(git config hooks.allownonascii)
 # them from being added to the repository. We exploit the fact that the
 # printable range starts at the space character and ends with tilde.
 if [ "$allownonascii" != "true" ] &&
+	# Note that the use of brackets around a tr range is ok here, (it's
+	# even required, for portability to Solaris 10's /usr/bin/tr), since
+	# the square bracket bytes happen to fall in the designated range.
 	test "$(git diff --cached --name-only --diff-filter=A -z |
 	  LC_ALL=C tr -d '[ -~]\0')"
 then
-	echo "Error: Attempt to add a non-ascii filename."
+	echo "Error: Attempt to add a non-ascii file name."
 	echo
-	echo "This can cause problems if you want to work together"
-	echo "with people on other platforms than you."
+	echo "This can cause problems if you want to work"
+	echo "with people on other platforms."
 	echo
-	echo "To be portable it is adviseable to rename the file ..."
+	echo "To be portable it is advisable to rename the file ..."
 	echo
 	echo "If you know what you are doing you can disable this"
 	echo "check using:"
--
1.6.5.rc1.214.g13c5a

^ permalink raw reply related

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Alex Riesen @ 2009-09-21 12:45 UTC (permalink / raw)
  To: Jim Meyering; +Cc: git list
In-Reply-To: <87ocp4imul.fsf@meyering.net>

On Mon, Sep 21, 2009 at 13:00, Jim Meyering <jim@meyering.net> wrote:
> Alex Riesen wrote:
>> On Mon, Sep 21, 2009 at 11:09, Jim Meyering <jim@meyering.net> wrote:
>>> However, if the use of [] is deliberate, because git still
>>> cares about portability to ancient SYSV versions of tr that
>>> require that notation, then let me know and I'll undo that part
>>> of the change and add a comment to that effect.
>>
>> We have (had?) people trying to support Git on HP-UX and SunOS.
>> Do these count?
>
> I had my doubts, but have just confirmed that Solaris 10's
> /usr/bin/tr is still doing it the SYSV way:
>
>    $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
>    foo
>
> There, you have to use /usr/xpg4/bin/tr to get the expected behavior:
>
>    $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
>    FOO
>
> So you're right.  ...

Sorry about that. I even made a simple tr once for Git tests
exactly because of compatibility problems (look for "poor man tr"
in the list archives, if needed).

^ permalink raw reply

* [RFC PATCH 2/8] git gui: teach delete dialog to open with a default remote
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

This is useful if you want to open the delete dialog with a preselected
remote. We use this in the next patch from this series.
---
 git-gui/lib/remote_branch_delete.tcl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-gui/lib/remote_branch_delete.tcl b/git-gui/lib/remote_branch_delete.tcl
index 2416420..e0dbc25 100644
--- a/git-gui/lib/remote_branch_delete.tcl
+++ b/git-gui/lib/remote_branch_delete.tcl
@@ -22,7 +22,7 @@ field head_cache
 field full_cache
 field cached
 
-constructor dialog {} {
+constructor dialog {{initial_remote origin}} {
 	global all_remotes M1B
 
 	make_toplevel top w
@@ -52,8 +52,8 @@ constructor dialog {} {
 			-variable @urltype
 		eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
 		grid $w.dest.remote_r $w.dest.remote_m -sticky w
-		if {[lsearch -sorted -exact $all_remotes origin] != -1} {
-			set remote origin
+		if {[lsearch -sorted -exact $all_remotes $initial_remote] != -1} {
+			set remote $initial_remote
 		} else {
 			set remote [lindex $all_remotes 0]
 		}
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 3/8] git gui: add checkbox to launch remote branch delete after push
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

This is useful when working with a central server and feature branches.
After a reviewer merged a feature branch into the upstream branch he
usually wants to delete this branch on the server after pushing the
upstream branch.

Save some clicks and open the delete dialog after pushing the upstream
branch.
---
 git-gui/git-gui.sh        |    1 +
 git-gui/lib/option.tcl    |    1 +
 git-gui/lib/transport.tcl |   28 ++++++++++++++++++++++++----
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index dfc1652..b32b8e7 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -738,6 +738,7 @@ set default_config(gui.pruneduringfetch) false
 set default_config(gui.trustmtime) false
 set default_config(gui.fastcopyblame) false
 set default_config(gui.emailafterpush) false
+set default_config(gui.deleteafterpush) false
 set default_config(gui.upstreambranch) {master}
 set default_config(gui.copyblamethreshold) 40
 set default_config(gui.blamehistoryctx) 7
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 55ecfe6..6bfe343 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -148,6 +148,7 @@ proc do_options {} {
 		{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
 		{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
 		{b gui.emailafterpush {mc "Open Email Composer after Push of Feature Branch"}}
+		{b gui.deleteafterpush {mc "Open Remote Delete Dialog On Push of Upstream Branch"}}
 		{t gui.upstreambranch {mc "Upstream branch"}}
 		{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
 		{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index 77a2f46..d717468 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -37,7 +37,7 @@ proc compose_email {to subject} {
 }
 
 proc after_push_anywhere_action {cons ok} {
-	global push_email r_url branches
+	global push_email delete_after_push r_url branches
 
 	console::done $cons $ok
 
@@ -52,13 +52,21 @@ proc after_push_anywhere_action {cons ok} {
 			set email_subject "Review%20request:%20$remote_short_name:$branches"
 			compose_email {} $email_subject
 		}
+		if {$delete_after_push} {
+			remote_branch_delete::dialog $r_url
+		}
 	}
 }
 
 proc do_push_on_change_branch {w} {
 	global upstream_branch
 
-	$w.options.email select
+	if {[is_config_true gui.emailafterpush]} {
+		$w.options.email select
+	}
+	if {[is_config_true gui.deleteafterpush]} {
+		$w.options.delete_after_push deselect
+	}
 
 	set cnt 0
 	set b {}
@@ -70,6 +78,7 @@ proc do_push_on_change_branch {w} {
 	if {$cnt != 1} {
 		$w.options.email deselect
 		$w.options.email configure -state disabled
+		$w.options.delete_after_push deselect
 		return
 	}
 
@@ -79,6 +88,9 @@ proc do_push_on_change_branch {w} {
 		if {[is_config_true gui.emailafterpush]} {
 			$w.options.email deselect
 		}
+		if {[is_config_true gui.deleteafterpush]} {
+			$w.options.delete_after_push select
+		}
 	}
 }
 
@@ -173,7 +185,8 @@ proc do_push_anywhere {} {
 		-width 70 \
 		-selectmode extended \
 		-yscrollcommand [list $w.source.sby set]
-	if {[is_config_true gui.emailafterpush]} {
+	if {[is_config_true gui.emailafterpush] \
+	    || [is_config_true gui.deleteafterpush]} {
 		bind $w.source.l <ButtonRelease-1> [list do_push_on_change_branch $w]
 	}
 	foreach h [load_all_heads] {
@@ -243,6 +256,11 @@ proc do_push_anywhere {} {
 		-variable push_email
 	grid $w.options.email -columnspan 2 -sticky w
 	$w.options.email deselect
+	checkbutton $w.options.delete_after_push \
+		-text [mc "Launch delete dialog after push"] \
+		-variable delete_after_push
+	grid $w.options.delete_after_push -columnspan 2 -sticky w
+	$w.options.delete_after_push deselect
 	grid columnconfigure $w.options 1 -weight 1
 	pack $w.options -anchor nw -fill x -pady 5 -padx 5
 
@@ -251,10 +269,12 @@ proc do_push_anywhere {} {
 	set push_thin 0
 	set push_tags 0
 	set push_email 0
+	set delete_after_push 0
 
 	set upstream_branch $repo_config(gui.upstreambranch)
 
-	if {[is_config_true gui.emailafterpush]} {
+	if {[is_config_true gui.emailafterpush] \
+	    || [is_config_true gui.deleteafterpush]} {
 		do_push_on_change_branch $w
 	}
 
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 0/8] Extend git gui for better "centralized" workflow integration
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce

This series is adding some more support for a centralized workflow with
code review based on feature branches. Most of it is plugging existing
functionality together so the most typical steps can be done at once.

In our team at $dayjob we use a workflow were each developer creates
feature branches and once he is satified with his change he sends out a
review request to another developer (the reviewer) which is most
familiar with the code parts involved in the change. If the reviewer
likes the change he merges it into the upstream branch (master). He then
publishes the new master and deletes the feature branch. Thats a quick
description of the workflow I am trying to add more support for with
this series.

There are still some TODO markers in there and if someone can help me
with those I would be very glad. This is the first time I am doing some
more extensive programming in tcl/tk and git gui so I hope you do not
tear everything apart ;)

The last patch is not really about the same topic but since it currently
relies on the changes of this series I included it nevertheless.

cheers Heiko


Heiko Voigt (8):
  git gui: add a "compose review email" checkbox to push dialog
  git gui: teach delete dialog to open with a default remote
  git gui: add checkbox to launch remote branch delete after push
  git gui: teach fetch operation to close dialog on successful
    completion
  git gui: do fetch from a default remote on startup
  git gui: add "review topic" menuitem which supports feature branch
    workflow
  Add documentation for git gui variables for email and delete after
    push
  git gui: make gc hint and fetch on startup sequential

 Documentation/config.txt             |   30 ++++++++++
 git-gui/git-gui.sh                   |   29 ++++++++-
 git-gui/lib/console.tcl              |    6 ++
 git-gui/lib/merge.tcl                |   83 ++++++++++++++++++++++++--
 git-gui/lib/option.tcl               |    5 ++
 git-gui/lib/remote_branch_delete.tcl |    6 +-
 git-gui/lib/transport.tcl            |  107 ++++++++++++++++++++++++++++++++-
 7 files changed, 250 insertions(+), 16 deletions(-)

^ permalink raw reply

* [RFC PATCH 4/8] git gui: teach fetch operation to close dialog on successful completion
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

---
 git-gui/lib/console.tcl   |    6 ++++++
 git-gui/lib/transport.tcl |   12 ++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/git-gui/lib/console.tcl b/git-gui/lib/console.tcl
index c112464..84eef13 100644
--- a/git-gui/lib/console.tcl
+++ b/git-gui/lib/console.tcl
@@ -168,6 +168,7 @@ method chain {cmdlist {ok 1}} {
 	} else {
 		done $this $ok
 	}
+	return $ok
 }
 
 method insert {txt} {
@@ -178,6 +179,11 @@ method insert {txt} {
 	$w_t conf -state disabled
 }
 
+method close_window {} {
+	wm protocol $w WM_DELETE_WINDOW {}
+	destroy $w
+}
+
 method done {ok} {
 	if {$ok} {
 		if {[winfo exists $w.m.s]} {
diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index d717468..39443ab 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -1,7 +1,7 @@
 # git-gui transport (fetch/push) support
 # Copyright (C) 2006, 2007 Shawn Pearce
 
-proc fetch_from {remote} {
+proc fetch_from {remote {close_after {}}} {
 	set w [console::new \
 		[mc "fetch %s" $remote] \
 		[mc "Fetching new changes from %s" $remote]]
@@ -10,7 +10,15 @@ proc fetch_from {remote} {
 	if {[is_config_true gui.pruneduringfetch]} {
 		lappend cmds [list exec git remote prune $remote]
 	}
-	console::chain $w $cmds
+	set ok [console::chain $w $cmds]
+
+	if {$ok} {
+		if {$close_after ne {}} {
+			console::close_window $w
+		}
+		return 1
+	}
+	return 0
 }
 
 proc prune_from {remote} {
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 1/8] git gui: add a "compose review email" checkbox to push dialog
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

This is useful when working with a central server. If a developer wants
to send his changes to a reviewer we can help him fill out the necessary
information about the branch he has pushed and launch his default email
composer.

Composition of such an email is currently only allowed for pushing one
branch because the subject line size is limited.
---
 git-gui/git-gui.sh        |    2 +
 git-gui/lib/option.tcl    |    2 +
 git-gui/lib/transport.tcl |   75 +++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 3c0ce26..dfc1652 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -737,6 +737,8 @@ set default_config(gui.matchtrackingbranch) false
 set default_config(gui.pruneduringfetch) false
 set default_config(gui.trustmtime) false
 set default_config(gui.fastcopyblame) false
+set default_config(gui.emailafterpush) false
+set default_config(gui.upstreambranch) {master}
 set default_config(gui.copyblamethreshold) 40
 set default_config(gui.blamehistoryctx) 7
 set default_config(gui.diffcontext) 5
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 1d55b49..55ecfe6 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -147,6 +147,8 @@ proc do_options {} {
 		{b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
 		{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
 		{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
+		{b gui.emailafterpush {mc "Open Email Composer after Push of Feature Branch"}}
+		{t gui.upstreambranch {mc "Upstream branch"}}
 		{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
 		{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
 		{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index b18d9c7..77a2f46 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -30,10 +30,63 @@ proc push_to {remote} {
 	console::exec $w $cmd
 }
 
+proc compose_email {to subject} {
+	set mail_link mailto:
+	append mail_link $to "?subject=" $subject
+	start_browser $mail_link
+}
+
+proc after_push_anywhere_action {cons ok} {
+	global push_email r_url branches
+
+	console::done $cons $ok
+
+	if {$ok} {
+		if {$push_email} {
+			set rconfig_var "remote.$r_url.url"
+			set remote_url [exec git config $rconfig_var]
+			set remote_short_name [lindex [split $remote_url / ] end ]
+			set remote_short_name [lindex [split $remote_short_name . ] 0 ]
+			# TODO: create a configuration variable for the
+			# subject
+			set email_subject "Review%20request:%20$remote_short_name:$branches"
+			compose_email {} $email_subject
+		}
+	}
+}
+
+proc do_push_on_change_branch {w} {
+	global upstream_branch
+
+	$w.options.email select
+
+	set cnt 0
+	set b {}
+	foreach i [$w.source.l curselection] {
+		set b [$w.source.l get $i]
+		incr cnt
+	}
+
+	if {$cnt != 1} {
+		$w.options.email deselect
+		$w.options.email configure -state disabled
+		return
+	}
+
+	$w.options.email configure -state normal
+
+	if { $b eq $upstream_branch } {
+		if {[is_config_true gui.emailafterpush]} {
+			$w.options.email deselect
+		}
+	}
+}
+
 proc start_push_anywhere_action {w} {
 	global push_urltype push_remote push_url push_thin push_tags
 	global push_force
 	global repo_config
+	global r_url branches
 
 	set is_mirror 0
 	set r_url {}
@@ -64,9 +117,11 @@ proc start_push_anywhere_action {w} {
 			[mc "Mirroring to %s" $r_url]]
 	} else {
 		set cnt 0
+		set branches {}
 		foreach i [$w.source.l curselection] {
 			set b [$w.source.l get $i]
 			lappend cmd "refs/heads/$b:refs/heads/$b"
+			lappend branches $b
 			incr cnt
 		}
 		if {$cnt == 0} {
@@ -81,7 +136,7 @@ proc start_push_anywhere_action {w} {
 			[mc "push %s" $r_url] \
 			[mc "Pushing %s %s to %s" $cnt $unit $r_url]]
 	}
-	console::exec $cons $cmd
+	console::exec $cons $cmd "after_push_anywhere_action $cons"
 	destroy $w
 }
 
@@ -91,7 +146,8 @@ trace add variable push_remote write \
 proc do_push_anywhere {} {
 	global all_remotes current_branch
 	global push_urltype push_remote push_url push_thin push_tags
-	global push_force
+	global push_force push_email upstream_branch
+	global repo_config
 
 	set w .push_setup
 	toplevel $w
@@ -117,6 +173,9 @@ proc do_push_anywhere {} {
 		-width 70 \
 		-selectmode extended \
 		-yscrollcommand [list $w.source.sby set]
+	if {[is_config_true gui.emailafterpush]} {
+		bind $w.source.l <ButtonRelease-1> [list do_push_on_change_branch $w]
+	}
 	foreach h [load_all_heads] {
 		$w.source.l insert end $h
 		if {$h eq $current_branch} {
@@ -179,6 +238,11 @@ proc do_push_anywhere {} {
 		-text [mc "Include tags"] \
 		-variable push_tags
 	grid $w.options.tags -columnspan 2 -sticky w
+	checkbutton $w.options.email \
+		-text [mc "Compose email with review request"] \
+		-variable push_email
+	grid $w.options.email -columnspan 2 -sticky w
+	$w.options.email deselect
 	grid columnconfigure $w.options 1 -weight 1
 	pack $w.options -anchor nw -fill x -pady 5 -padx 5
 
@@ -186,6 +250,13 @@ proc do_push_anywhere {} {
 	set push_force 0
 	set push_thin 0
 	set push_tags 0
+	set push_email 0
+
+	set upstream_branch $repo_config(gui.upstreambranch)
+
+	if {[is_config_true gui.emailafterpush]} {
+		do_push_on_change_branch $w
+	}
 
 	bind $w <Visibility> "grab $w; focus $w.buttons.create"
 	bind $w <Key-Escape> "destroy $w"
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 5/8] git gui: do fetch from a default remote on startup
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

In many situations the very first thing you do after starting git gui is
to fetch the newest changes from your main remote. Lets have git gui do
the work automatically and save us some clicking.

We add two configuration variables (one to enable the feature and one
specifying the default remote) so the remote can be reused in another
patch which adds a "Review Topic" merge item later in this series.
---
 git-gui/git-gui.sh     |    8 ++++++++
 git-gui/lib/option.tcl |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index b32b8e7..2a2bd38 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -740,6 +740,8 @@ set default_config(gui.fastcopyblame) false
 set default_config(gui.emailafterpush) false
 set default_config(gui.deleteafterpush) false
 set default_config(gui.upstreambranch) {master}
+set default_config(gui.defaultremote) {origin}
+set default_config(gui.fetchonstartup) false
 set default_config(gui.copyblamethreshold) 40
 set default_config(gui.blamehistoryctx) 7
 set default_config(gui.diffcontext) 5
@@ -3495,6 +3497,12 @@ after 1 {
 		$ui_comm configure -state disabled -background gray
 	}
 }
+
+set defaultremote $repo_config(gui.defaultremote)
+if {[is_config_true gui.fetchonstartup] && $defaultremote ne {}} {
+	after 500 {fetch_from $defaultremote {close_on_success}}
+}
+
 if {[is_enabled multicommit]} {
 	after 1000 hint_gc
 }
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 6bfe343..defeb54 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -149,7 +149,9 @@ proc do_options {} {
 		{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
 		{b gui.emailafterpush {mc "Open Email Composer after Push of Feature Branch"}}
 		{b gui.deleteafterpush {mc "Open Remote Delete Dialog On Push of Upstream Branch"}}
+		{b gui.fetchonstartup {mc "Fetch default remote on startup"}}
 		{t gui.upstreambranch {mc "Upstream branch"}}
+		{t gui.defaultremote {mc "Default remote repository"}}
 		{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
 		{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
 		{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 8/8] git gui: make gc hint and fetch on startup sequential
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

On large repositories (especially on Windows) doing any harddrive usage
during the initial status scan slows the whole process down. So this
postpones the question for compressing loose objects and fetching of the
default remote until after that.
---
 git-gui/git-gui.sh |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 3e3c7cd..19b1ad6 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2031,8 +2031,22 @@ proc do_quit {{rc {1}}} {
 	destroy .
 }
 
+proc ui_finalize_startup {} {
+	global repo_config
+
+	set defaultremote $repo_config(gui.defaultremote)
+	if {[is_config_true gui.fetchonstartup] && $defaultremote ne {}} {
+		fetch_from $defaultremote {close_on_success}
+	}
+
+	if {[is_enabled multicommit]} {
+		hint_gc
+	}
+	ui_ready
+}
+
 proc do_rescan {} {
-	rescan ui_ready
+	rescan ui_finalize_startup
 }
 
 proc ui_do_rescan {} {
@@ -3502,14 +3516,6 @@ after 1 {
 	}
 }
 
-set defaultremote $repo_config(gui.defaultremote)
-if {[is_config_true gui.fetchonstartup] && $defaultremote ne {}} {
-	after 500 {fetch_from $defaultremote {close_on_success}}
-}
-
-if {[is_enabled multicommit]} {
-	after 1000 hint_gc
-}
 if {[is_enabled retcode]} {
 	bind . <Destroy> {+terminate_me %W}
 }
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 6/8] git gui: add "review topic" menuitem which supports feature branch workflow
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

We have a setup where each developer publishes feature branches on a
central server. These branches then become merged into the upstream
branch (master in most times) by another developer designated as the
reviewer.

The review process usually involves several steps (fetch remote branches,
update local upstream branch to server branch, review in gitk, merge).
To combine this operation into one step we add a new menu item "Review
Topic" under the merge menu which guides the user through all the steps.

After "Review Topic" has finished the only thing left to do is to push
the current branch (which is the upstream branch) and delete the feature
branch. Support for which has been implemented in an ealier patch in
this series.
---
 git-gui/git-gui.sh    |    4 ++
 git-gui/lib/merge.tcl |   83 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 2a2bd38..3e3c7cd 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2557,6 +2557,10 @@ if {[is_enabled branch]} {
 		-accelerator $M1T-M
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
+	.mbar.merge add command -label [mc "Review Topic..."] \
+		-command {merge::dialog review}
+	lappend disable_on_lock \
+		[list .mbar.merge entryconf [.mbar.merge index last] -state]
 	.mbar.merge add command -label [mc "Abort Merge..."] \
 		-command merge::reset_hard
 	lappend disable_on_lock \
diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
index 283e491..3716cf3 100644
--- a/git-gui/lib/merge.tcl
+++ b/git-gui/lib/merge.tcl
@@ -81,14 +81,70 @@ method _visualize {} {
 	}
 }
 
+method _update_upstream {} {
+	global repo_config index_lock_type
+
+	set upstream_branch $repo_config(gui.upstreambranch)
+	set remote $repo_config(gui.defaultremote)
+
+	if {$upstream_branch eq {} || $remote eq {}} {
+		info_popup [mc "You need to set the configuration \
+			variables gui.upstreambranch and gui.defaultremote so \
+			review topic can work"]
+		return 0
+	}
+
+	#TODO: find out why this does not return on failure
+	if {![fetch_from $remote {close_on_success}]} {
+		return 0
+	}
+
+	set co [::checkout_op::new \
+		$remote/$upstream_branch \
+		{} \
+		refs/heads/$upstream_branch]
+
+	#TODO:
+	#$co parent $w
+	$co enable_create   1
+	$co enable_merge    ff
+	$co enable_checkout 1
+
+	set spec [list refs/remotes/$remote/$upstream_branch \
+	                       $remote \
+			       refs/heads/$upstream_branch]
+
+	$co enable_fetch $spec
+	$co remote_source $spec
+
+	if {[$co run]} {
+		while {$index_lock_type ne {none}} {
+			vwait index_lock_type
+		}
+		return 1
+	} else {
+		while {$index_lock_type ne {none}} {
+			vwait index_lock_type
+		}
+		return 0
+	}
+}
+
 method _start {} {
-	global HEAD current_branch remote_url
+	global HEAD current_branch remote_url merge_type
 
 	set name [_rev $this]
 	if {$name eq {}} {
 		return
 	}
 
+	if {$merge_type eq "review"} {
+		_visualize $this
+		$w.buttons.merge configure -text [mc Merge]
+		set merge_type normal
+		return
+	}
+
 	set spec [$w_rev get_tracking_branch]
 	set cmit [$w_rev get_commit]
 
@@ -137,17 +193,34 @@ method _finish {cons ok} {
 	delete_this
 }
 
-constructor dialog {} {
+constructor dialog {{dialog_type normal}} {
 	global current_branch
 	global M1B
+	global merge_type
+
+	set merge_type $dialog_type
+	set start_button [mc Merge]
+	set action_name "Merge Into"
+	set dialog_title [mc "Merge"]
+
+	if { $merge_type eq "review" } {
+		if {![_update_upstream $this]} {
+			delete_this
+			return
+		}
+		set start_button [mc Review]
+		set action_name [mc "Review for Merge Into"]
+		set dialog_title [mc Review]
+	}
 
 	if {![_can_merge $this]} {
+		info_popup failed_can_merge
 		delete_this
 		return
 	}
 
 	make_toplevel top w
-	wm title $top [append "[appname] ([reponame]): " [mc "Merge"]]
+	wm title $top [append "[appname] ([reponame]): " $dialog_title]
 	if {$top ne {.}} {
 		wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
 	}
@@ -155,7 +228,7 @@ constructor dialog {} {
 	set _start [cb _start]
 
 	label $w.header \
-		-text [mc "Merge Into %s" $current_branch] \
+		-text [mc "$action_name %s" $current_branch] \
 		-font font_uibold
 	pack $w.header -side top -fill x
 
@@ -165,7 +238,7 @@ constructor dialog {} {
 		-command [cb _visualize]
 	pack $w.buttons.visualize -side left
 	button $w.buttons.merge \
-		-text [mc Merge] \
+		-text $start_button \
 		-command $_start
 	pack $w.buttons.merge -side right
 	button $w.buttons.cancel \
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* [RFC PATCH 7/8] Add documentation for git gui variables for email and delete after push
From: Heiko Voigt @ 2009-09-21 13:06 UTC (permalink / raw)
  To: git; +Cc: spearce
In-Reply-To: <cover.1253481338.git.hvoigt@hvoigt.net>

---
 Documentation/config.txt |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index c6f09f8..4174ab4 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -957,6 +957,36 @@ gui.blamehistoryctx::
 	Context` menu item is invoked from 'git gui blame'. If this
 	variable is set to zero, the whole history is shown.
 
+gui.emailafterpush::
+	The push dialog can compose a review email if you push a feature
+	branch. If this option is set to true the checkbox will be
+	automatically enabled when you select a feature branch. The
+	upstream (main) branch is determined from the
+	`gui.upstreambranch` option.
+
+gui.deleteafterpush::
+	If you push a branch in git gui you can enable a checkbox which
+	will open the remote delete branch dialog after a push. Setting
+	this variable to true will automatically check that checkbox
+	when you select to push the upstream (main) branch. The upstream
+	branch can be configured using the `gui.upstreambranch` configuration
+	variable.
+
+gui.upstreambranch::
+	This configures which branchname will be referred to as the
+	upstream (main) branch on remote repositories. Currently this
+	option is used in combination with the options
+	`gui.emailafterpush` and `gui.deleteafterpush`.
+
+gui.fetchonstartup::
+	Boolean, if set all branches from remote determined by
+	`gui.defaulremote` will be fetched on startup of git gui.
+
+gui.defaultremote::
+	String variable which determines from which remote git gui will
+	automatically start a fetch on startup. If this variable is not
+	set the automatic fetch is disabled.
+
 guitool.<name>.cmd::
 	Specifies the shell command line to execute when the corresponding item
 	of the linkgit:git-gui[1] `Tools` menu is invoked. This option is
-- 
1.6.5.rc1.12.gc72fe

^ permalink raw reply related

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Jeff King @ 2009-09-21 13:44 UTC (permalink / raw)
  To: Jim Meyering; +Cc: Alex Riesen, git list
In-Reply-To: <87ocp4imul.fsf@meyering.net>

On Mon, Sep 21, 2009 at 01:00:34PM +0200, Jim Meyering wrote:

> > We have (had?) people trying to support Git on HP-UX and SunOS.
> > Do these count?
> 
> I had my doubts, but have just confirmed that Solaris 10's
> /usr/bin/tr is still doing it the SYSV way:
> 
>     $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
>     foo
> 
> There, you have to use /usr/xpg4/bin/tr to get the expected behavior:
> 
>     $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
>     FOO
> 
> So you're right.  Thanks!

See:

  http://article.gmane.org/gmane.comp.version-control.git/76991

> +	# Note that the use of brackets around a tr range is ok here, (it's
> +	# even required, for portability to Solaris 10's /usr/bin/tr), since
> +	# the square bracket bytes happen to fall in the designated range.
>  	test "$(git diff --cached --name-only --diff-filter=A -z |
>  	  LC_ALL=C tr -d '[ -~]\0')"

Does this work on non-bracket systems? I would think that enumerating
the sequence would be the most portable thing.

-Peff

^ permalink raw reply

* RE: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository
From: Murphy, John @ 2009-09-21 14:02 UTC (permalink / raw)
  To: Paul Mackerras, Pat Thoyts, Johannes Sixt; +Cc: git
In-Reply-To: <19124.8378.975976.347711@cargo.ozlabs.ibm.com>

Johannes Sixt writes:

> I cannot reproduce the error. I have a repository with 100 commits in
a
> linear history and 5000 refs (50 refs per commit). They are named
> refs/heads/branch-XXXX. I don't see any problems with 'gitk --all'.

That still leave you with only 100 unique refs.
You need over 797 unique refs.

> The error must be in some other git invocation.

I put many debug pop-ups around the code and I believe that this the
call that is dying on.
This is the only part of the code that has the error text "fatal:
ambiguous argument".


Paul Mackerras writes:

> I knew about the 32k command-line limit under windows, but I don't see
> how that applies in this case unless it is $revs that is too long (and
> if that is the case then I don't see how your patch helps).  Is there
> also a 32k limit on the size of data returned by a command executed
> with [exec]?

In this case $revs is "--all"

I believe what I am experiencing is a 32K limit with [exec]

Additional info:
My repo has: 17,737 commits

^ permalink raw reply

* Re: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository
From: Johannes Sixt @ 2009-09-21 14:09 UTC (permalink / raw)
  To: Murphy, John; +Cc: Paul Mackerras, Pat Thoyts, git
In-Reply-To: <6F87406399731F489FBACE5C5FFA0458518DE8@ex2k.bankofamerica.com>

Murphy, John schrieb:
> Paul Mackerras writes:
> 
>> I knew about the 32k command-line limit under windows, but I don't see
>> how that applies in this case unless it is $revs that is too long (and
>> if that is the case then I don't see how your patch helps).  Is there
>> also a 32k limit on the size of data returned by a command executed
>> with [exec]?
> 
> In this case $revs is "--all"
> 
> I believe what I am experiencing is a 32K limit with [exec]

But in order to have a $revs that exceeds 32K, you would already have to
invoke gitk with a huge command line that exceeds the limit (but this is
not possible), no?

How do you run gitk?

-- Hannes

^ permalink raw reply

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Jim Meyering @ 2009-09-21 14:10 UTC (permalink / raw)
  To: Jeff King; +Cc: Alex Riesen, git list
In-Reply-To: <20090921134427.GA20567@sigio.peff.net>

Jeff King wrote:

> On Mon, Sep 21, 2009 at 01:00:34PM +0200, Jim Meyering wrote:
>
>> > We have (had?) people trying to support Git on HP-UX and SunOS.
>> > Do these count?
>>
>> I had my doubts, but have just confirmed that Solaris 10's
>> /usr/bin/tr is still doing it the SYSV way:
>>
>>     $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
>>     foo
>>
>> There, you have to use /usr/xpg4/bin/tr to get the expected behavior:
>>
>>     $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
>>     FOO
>>
>> So you're right.  Thanks!
>
> See:
>
>   http://article.gmane.org/gmane.comp.version-control.git/76991
>
>> +	# Note that the use of brackets around a tr range is ok here, (it's
>> +	# even required, for portability to Solaris 10's /usr/bin/tr), since
>> +	# the square bracket bytes happen to fall in the designated range.
>>  	test "$(git diff --cached --name-only --diff-filter=A -z |
>>  	  LC_ALL=C tr -d '[ -~]\0')"
>
> Does this work on non-bracket systems?

Yes, since [] happen to fall in the range.

> I would think that enumerating
> the sequence would be the most portable thing.

Enumerating is more portable, at the expense of
readability and maintainability.
In case you want to go that route, here's one more:

(note that this, like the original range, treats TAB as nonportable)

>From 40a368a7bcf0ac6524bbe36ba3bfdaa0711897b8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 21 Sep 2009 10:58:02 +0200
Subject: [PATCH] pre-commit.sample: use tr more portability; fix grammar

Avoid tr's M-N range notation altogether.
Instead, enumerate ascii bytes 32..126.
Correct spelling and grammar.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 templates/hooks--pre-commit.sample |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index b11ad6a..896eb9e 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks--pre-commit.sample
@@ -10,19 +10,26 @@
 # If you want to allow non-ascii filenames set this variable to true.
 allownonascii=$(git config hooks.allownonascii)

+printables=' !"#$%&'\''()*+,-./0123456789:;<=>?@'
+printables="$printables"'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`'
+printables="$printables"'abcdefghijklmnopqrstuvwxyz{|}~'
+
 # Cross platform projects tend to avoid non-ascii filenames; prevent
 # them from being added to the repository. We exploit the fact that the
 # printable range starts at the space character and ends with tilde.
 if [ "$allownonascii" != "true" ] &&
-	test "$(git diff --cached --name-only --diff-filter=A -z |
-	  LC_ALL=C tr -d '[ -~]\0')"
+	# Filter out printable ascii bytes, and NUL.
+	# If anything remains, you lose.
+        rem=$(git diff --cached --name-only --diff-filter=A -z |
+	      LC_ALL=C tr -d "$printables"'\0')
+	test -n "$rem"
 then
-	echo "Error: Attempt to add a non-ascii filename."
+	echo "Error: Attempt to add a non-ascii file name."
 	echo
-	echo "This can cause problems if you want to work together"
-	echo "with people on other platforms than you."
+	echo "This can cause problems if you want to work"
+	echo "with people on other platforms."
 	echo
-	echo "To be portable it is adviseable to rename the file ..."
+	echo "To be portable it is advisable to rename the file ..."
 	echo
 	echo "If you know what you are doing you can disable this"
 	echo "check using:"
--
1.6.5.rc1.214.g13c5a

^ permalink raw reply related

* RE: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository
From: Murphy, John @ 2009-09-21 14:11 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Paul Mackerras, Pat Thoyts, git
In-Reply-To: <4AB78910.7010402@viscovery.net>

Johannes Sixt writes:

> But in order to have a $revs that exceeds 32K, you would already have
to
> invoke gitk with a huge command line that exceeds the limit (but this
is
> not possible), no?

>How do you run gitk?

gitk --all

^ permalink raw reply

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Jeff King @ 2009-09-21 14:21 UTC (permalink / raw)
  To: Jim Meyering; +Cc: Alex Riesen, git list
In-Reply-To: <87tyywgzhu.fsf@meyering.net>

On Mon, Sep 21, 2009 at 04:10:21PM +0200, Jim Meyering wrote:

> >>  	test "$(git diff --cached --name-only --diff-filter=A -z |
> >>  	  LC_ALL=C tr -d '[ -~]\0')"
> >
> > Does this work on non-bracket systems?
> 
> Yes, since [] happen to fall in the range.
> 
> > I would think that enumerating
> > the sequence would be the most portable thing.
> 
> Enumerating is more portable, at the expense of
> readability and maintainability.
> In case you want to go that route, here's one more:

Agreed. If we can avoid enumeration, we should. If your original is
portable, then I think it is preferable. Thanks for looking into it.

-Peff

^ permalink raw reply

* Re: [PATCH] Trivial fix: Make all the builtin usage strings to use the same pattern.
From: Brandon Casey @ 2009-09-21 15:28 UTC (permalink / raw)
  To: Thiago Farina; +Cc: git
In-Reply-To: <1253452645-3220-1-git-send-email-tfransosi@gmail.com>

Thiago Farina wrote:
> They follow the pattern of file name:
> File name pattern: builtin-command-name.c
> Usage string pattern: builtin_command_name_usage
> 
> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
> ---

> diff --git a/builtin-blame.c b/builtin-blame.c
> index 7512773..4adae84 100644
> --- a/builtin-blame.c
> +++ b/builtin-blame.c
> @@ -21,10 +21,11 @@
>  #include "parse-options.h"
>  #include "utf8.h"
>  
> -static char blame_usage[] = "git blame [options] [rev-opts] [rev] [--] file";
> +static char builtin_blame_usage[] =

Should this one also use 'const'?

> +"git blame [options] [rev-opts] [rev] [--] file";
>  
>  static const char *blame_opt_usage[] = {
> -	blame_usage,
> +	builtin_blame_usage,
>  	"",
>  	"[rev-opts] are documented in git-rev-list(1)",
>  	NULL

> diff --git a/builtin-count-objects.c b/builtin-count-objects.c
> index 1b0b6c8..fbe0972 100644
> --- a/builtin-count-objects.c
> +++ b/builtin-count-objects.c
> @@ -65,7 +65,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose,
>  	}
>  }
>  
> -static char const * const count_objects_usage[] = {
> +static char const * const builtin_count_objects_usage[] = {

This one is different from the others.  I assume 'char const *' is
the same as 'const char *', though I'm used to seeing the latter
form.  If we're going for consistency, maybe this should be changed
too.  Ultra minor nit-pick.  I noticed it, so I mentioned it, but
its your choice.

>  	"git count-objects [-v]",
>  	NULL
>  };

> diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
> index a5a83f1..715d378 100644
> --- a/builtin-for-each-ref.c
> +++ b/builtin-for-each-ref.c
> @@ -881,7 +881,7 @@ static int opt_parse_sort(const struct option *opt, const char *arg, int unset)
>  	return 0;
>  }
>  
> -static char const * const for_each_ref_usage[] = {
> +static char const * const builtin_for_each_ref_usage[] = {

ditto

>  	"git for-each-ref [options] [<pattern>]",
>  	NULL
>  };

> diff --git a/builtin-fsck.c b/builtin-fsck.c
> index c58b0e3..0857357 100644
> --- a/builtin-fsck.c
> +++ b/builtin-fsck.c
> @@ -564,7 +564,7 @@ static int fsck_cache_tree(struct cache_tree *it)
>  	return err;
>  }
>  
> -static char const * const fsck_usage[] = {
> +static char const * const builtin_fsck_usage[] = {

ditto

>  	"git fsck [options] [<object>...]",
>  	NULL
>  };

^ permalink raw reply

* Re: [PATCH] pre-commit.sample: don't use [...] around a tr range
From: Brandon Casey @ 2009-09-21 15:58 UTC (permalink / raw)
  To: Jeff King; +Cc: Jim Meyering, Alex Riesen, git list
In-Reply-To: <20090921134427.GA20567@sigio.peff.net>

Jeff King wrote:
> On Mon, Sep 21, 2009 at 01:00:34PM +0200, Jim Meyering wrote:
> 
>>> We have (had?) people trying to support Git on HP-UX and SunOS.
>>> Do these count?
>> I had my doubts, but have just confirmed that Solaris 10's
>> /usr/bin/tr is still doing it the SYSV way:
>>
>>     $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
>>     foo
>>
>> There, you have to use /usr/xpg4/bin/tr to get the expected behavior:
>>
>>     $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
>>     FOO
>>
>> So you're right.  Thanks!

By the way, modern git inserts /usr/xpg4/bin into PATH before /usr/bin on
Solaris.  So /usr/xpg4/bin/tr should always be used on that platform.

-brandon

^ permalink raw reply

* Re: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository
From: Johannes Sixt @ 2009-09-21 15:59 UTC (permalink / raw)
  To: Murphy, John; +Cc: Paul Mackerras, Pat Thoyts, git
In-Reply-To: <6F87406399731F489FBACE5C5FFA0458518E11@ex2k.bankofamerica.com>

Murphy, John schrieb:
> Johannes Sixt writes:
> 
>> But in order to have a $revs that exceeds 32K, you would already have
> to
>> invoke gitk with a huge command line that exceeds the limit (but this
> is
>> not possible), no?
> 
>> How do you run gitk?
> 
> gitk --all

I see it. Here is a bash script that creates a repository that reproduces
the error. It is important that refs which sort alphabetically earlier
also point to earlier commits.

-- snip --
#!/bin/bash
git init
echo initial > file && git add file && git commit -m initial
for ((i = 0; i < 1000; i++))
do
	echo $i > file &&
	git commit -m $i file > /dev/null &&
	printf -v l "branch-%04d" $i &&
	git update-ref refs/heads/$l HEAD
done
git gc
-- snip --

On Windows, 'gitk --all' starts with branch-0797, on Linux it starts with
branch-0999 aka master.

I'm just throwing this out to interested parties; I'll not look into it at
this time.

Thanks,
-- Hannes

^ permalink raw reply

* Re: [PATCH] Trivial fix: Make all the builtin usage strings to use the same pattern.
From: Johannes Sixt @ 2009-09-21 16:09 UTC (permalink / raw)
  To: Thiago Farina; +Cc: git
In-Reply-To: <1253452645-3220-1-git-send-email-tfransosi@gmail.com>

Thiago Farina schrieb:
> They follow the pattern of file name:
> File name pattern: builtin-command-name.c
> Usage string pattern: builtin_command_name_usage

Well, file names are not so constant: every now and then an external
command is turned into a builtin (and the filename is changed), and we
have even seen that a builtin was turned into an external command.
Moreover, some commands are implemented in the same file, for example 'git
log' and 'git show'. How about naming the variable after the command name?
E.g.:

command:  git cat-file
variable: git_cat_file_usage

-- Hannes

^ permalink raw reply

* install does not obey DESTDIR or --prefix for perl modules
From: Craig Taylor @ 2009-09-21 16:05 UTC (permalink / raw)
  To: git

Hi all

I'm compiling/installing git in a Solaris environment without root.
Using 'make DESTDIR=<some path> install' to stage an install to an
alternate location.
The perl module component of 'make DESTDIR=<some path> install' installs
into the system perl lib path without prepending the forced install
destination or my '--prefix'.
This seems counter intuitive and I would consider a bug.

Regards
CraigT

-- 

c^ [c%5e]

The bamboo-shadows move over the stone steps
as if to sweep them, but no dust is stirred;
The moon is reflected deep in the pool, but the
water shows no trace of its penetration.

^ permalink raw reply

* [PATCH] git-submodule should obey --quiet for subcommands
From: Jonathan del Strother @ 2009-09-21 16:46 UTC (permalink / raw)
  To: Git Mailing List

Make sure that --quiet is passed through to git-clone & git-fetch.

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
clone & fetch are extremely noisy - perhaps something like the following?

 git-submodule.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index bfbd36b..1e1066e 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -106,9 +106,9 @@ module_clone()

 	if test -n "$reference"
 	then
-		git-clone "$reference" -n "$url" "$path"
+		git-clone ${GIT_QUIET:+-q} "$reference" -n "$url" "$path"
 	else
-		git-clone -n "$url" "$path"
+		git-clone ${GIT_QUIET:+-q} -n "$url" "$path"
 	fi ||
 	die "Clone of '$url' into submodule path '$path' failed"
 }
@@ -450,7 +450,7 @@ cmd_update()
 			if test -z "$nofetch"
 			then
 				(unset GIT_DIR; cd "$path" &&
-					git-fetch) ||
+					git-fetch ${GIT_QUIET:+-q}) ||
 				die "Unable to fetch in submodule path '$path'"
 			fi

-- 
1.6.5.rc1.44.ga1675.dirty

^ permalink raw reply related

* Re: install does not obey DESTDIR or --prefix for perl modules
From: Brandon Casey @ 2009-09-21 16:58 UTC (permalink / raw)
  To: c; +Cc: git
In-Reply-To: <20090921160551.GD8173@gryning.com>

Craig Taylor wrote:
> Hi all
> 
> I'm compiling/installing git in a Solaris environment without root.
> Using 'make DESTDIR=<some path> install' to stage an install to an
> alternate location.
> The perl module component of 'make DESTDIR=<some path> install' installs
> into the system perl lib path without prepending the forced install
> destination or my '--prefix'.
> This seems counter intuitive and I would consider a bug.

Try 'make prefix=<some path>'.

btw, this is in the first paragraph of the INSTALL document.

-brandon

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox