Git development
 help / color / mirror / Atom feed
* Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags
From: Bert Wesarg @ 2010-12-06 22:17 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Shawn O. Pearce, git
In-Reply-To: <87aakiy3lt.fsf@fox.patthoyts.tk>

On Mon, Dec 6, 2010 at 22:48, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>>This covers also the case for newly added files in the index. Like this:
>>
>>    echo bar >foo
>>    git add foo
>>    rm foo
>>    ln -s bar foo
>>
>>This will result in an state of AT. And for cases where the type change is
>>staged, and the new type was modified after the staging. Like this (cont.):
>>
>>    git add foo
>>    git commit -mfoo
>>    rm foo
>>    echo bar >foo
>>    git add foo
>>    echo baz >foo
>>
>>Will result in an state of TM for foo.
>>
>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>---
>> git-gui.sh |    6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>>diff --git a/git-gui.sh b/git-gui.sh
>>index 38362fa..1bebcf1 100755
>>--- a/git-gui.sh
>>+++ b/git-gui.sh
>>@@ -1993,7 +1993,9 @@ foreach i {
>>               {MD {mc "Staged for commit, missing"}}
>>
>>               {_T {mc "File type changed, not staged"}}
>>+              {AT {mc "File type changed, old type staged for commit"}}
>>               {T_ {mc "File type changed, staged"}}
>>+              {TM {mc "Staged file type change, modification not staged"}}
>>
>>               {_O {mc "Untracked, not staged"}}
>>               {A_ {mc "Staged for commit"}}
>>@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
>>                       || $current_diff_path eq {}
>>                       || {__} eq $state
>>                       || {_O} eq $state
>>-                      || {_T} eq $state
>>-                      || {T_} eq $state
>>+                      || [string match {?T} $state]
>>+                      || [string match {T?} $state]
>>                       || [has_textconv $current_diff_path]} {
>>                       set s disabled
>>               } else {
>
> This seems fine. We do get a warning about an 'unhandled 2 way diff
> marker' when it bumps into the second 'diff --git a/foo b/foo' section
> but I'm not sure anything can be safely done about that.

We had this before, and you have proposed a fix for that ("git-gui:
handle symlink replaced by file"). But as I wrote I have a better and
nicer solution to that specific problem.

Bert

> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>
>

^ permalink raw reply

* Re: [PATCH] logging branch deletion to help recovering from mistakes
From: Štěpán Němec @ 2010-12-06 21:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vlj42siu5.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

[...]

Just two cosmetic nits I noticed:

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index d82c0da..bdf90eb 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -351,6 +351,12 @@ This value is true by default in a repository that has
>  a working directory associated with it, and false by
>  default in a bare repository.
>  
> +core.logRefDeletion::
> +	Enable logging of eletion of refs (e.g. branches), allowing `git
                          ^^^^^^^

[...]

> diff --git a/refs.c b/refs.c
> index e3c0511..afdd634 100644
> --- a/refs.c
> +++ b/refs.c

[...]

> -	/* removing the loose one could have resurrected an earlier
> -	 * packed one.  Also, if it was not loose we need to repack
> -	 * without it.
> -	 */

Could also the first sentence start with a capital letter?

[...]

> +		if (!(delopt & REF_NODEREF))
> +			lock->lk->filename[i] = '.';
> +	}
> +	/*
> +	 * removing the loose one could have resurrected an earlier
> +	 * packed one.  Also, if it was not loose we need to repack
> +	 * without it.
> +	 */

Same here.

Thank you,

  Štěpán

^ permalink raw reply

* Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags
From: Pat Thoyts @ 2010-12-06 21:48 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Shawn O. Pearce, git
In-Reply-To: <50fc511f363e8b13b9b1a27db71136d262c95f0d.1291155371.git.bert.wesarg@googlemail.com>

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>This covers also the case for newly added files in the index. Like this:
>
>    echo bar >foo
>    git add foo
>    rm foo
>    ln -s bar foo
>
>This will result in an state of AT. And for cases where the type change is
>staged, and the new type was modified after the staging. Like this (cont.):
>
>    git add foo
>    git commit -mfoo
>    rm foo
>    echo bar >foo
>    git add foo
>    echo baz >foo
>
>Will result in an state of TM for foo.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> git-gui.sh |    6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/git-gui.sh b/git-gui.sh
>index 38362fa..1bebcf1 100755
>--- a/git-gui.sh
>+++ b/git-gui.sh
>@@ -1993,7 +1993,9 @@ foreach i {
> 		{MD {mc "Staged for commit, missing"}}
> 
> 		{_T {mc "File type changed, not staged"}}
>+		{AT {mc "File type changed, old type staged for commit"}}
> 		{T_ {mc "File type changed, staged"}}
>+		{TM {mc "Staged file type change, modification not staged"}}
> 
> 		{_O {mc "Untracked, not staged"}}
> 		{A_ {mc "Staged for commit"}}
>@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
> 			|| $current_diff_path eq {}
> 			|| {__} eq $state
> 			|| {_O} eq $state
>-			|| {_T} eq $state
>-			|| {T_} eq $state
>+			|| [string match {?T} $state]
>+			|| [string match {T?} $state]
> 			|| [has_textconv $current_diff_path]} {
> 			set s disabled
> 		} else {

This seems fine. We do get a warning about an 'unhandled 2 way diff
marker' when it bumps into the second 'diff --git a/foo b/foo' section
but I'm not sure anything can be safely done about that.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply

* Re: path/to/some/file: needs update
From: Ben Walton @ 2010-12-06 20:47 UTC (permalink / raw)
  To: Patrick Doyle; +Cc: Matthieu Moy, git
In-Reply-To: <AANLkTinFHFzjLNb5PpoH8WG_3gHpo4LaZaUOYX-=PFYN@mail.gmail.com>

Excerpts from Patrick Doyle's message of Sun Dec 05 19:44:32 -0500 2010:

> I just checked.  The box they were using is an RHEL 5 box that has
> 1.5.5.6 installed on it.  Perhaps it's time to upgrade their git.
> I'll go see what repo I need to add to RHEL to get a more recent
> git.

I maintain a local set of 1.7.x rpms for git that are built for rhel5
here.  I'm happy to share if it would help.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

^ permalink raw reply

* Re: Git Gui does not want to work on chunk level
From: Bert Wesarg @ 2010-12-06 21:30 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Shawn O. Pearce, Alexander Gladysh, git, Pat Thoyts
In-Reply-To: <AANLkTikd84--37+vcoHifqFeUGznEQ9YXDaY3a3zOekn@mail.gmail.com>

On Tue, Nov 30, 2010 at 23:20, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Tue, Nov 30, 2010 at 22:19, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> On Mon, Sep 15, 2008 at 09:08, Johannes Sixt <j.sixt@viscovery.net> wrote:
>>>  new file mode 100644
>>>  --- /dev/null
>>>  +++ b/foo
>>>  @@ -0,0 +1 @@
>>>  +foo
>>
>> I just noticed the same, and ask me why this report wasn't honored.
>>
>> Also git may spill out 2 diffs for type changes (file to symlink, for
>> example). In this case the we should probably disable any hunk- or
>> line-level (un)staging.
>
> Here is a proposal which fixes this case. Not tested on the OPs report.
>
> --8<--
> diff --git a/lib/diff.tcl b/lib/diff.tcl
> index 8fea947..b3901c3 100644
> --- a/lib/diff.tcl
> +++ b/lib/diff.tcl
> @@ -398,7 +398,6 @@ proc read_diff {fd conflict_size cont_info} {
>                if {$line eq {deleted file mode 120000}} {
>                        set line "deleted symlink"
>                }
> -               set ::current_diff_inheader 0
>
>                # -- Automatically detect if this is a 3 way diff.
>                #
> @@ -414,6 +413,7 @@ proc read_diff {fd conflict_size cont_info} {
>                        || [regexp {^\* Unmerged path } $line]} {
>                        set tags {}
>                } elseif {$is_3way_diff} {
> +                       set ::current_diff_inheader 0
>                        set op [string range $line 0 1]
>                        switch -- $op {
>                        {  } {set tags {}}
> @@ -440,6 +440,7 @@ proc read_diff {fd conflict_size cont_info} {
>                        }
>                        }
>                } elseif {$is_submodule_diff} {
> +                       set ::current_diff_inheader 0
>                        if {$line == ""} continue
>                        if {[regexp {^Submodule } $line]} {
>                                set tags d_@
> @@ -459,6 +460,7 @@ proc read_diff {fd conflict_size cont_info} {
>                                }
>                        }
>                } else {
> +                       set ::current_diff_inheader 0
>                        set op [string index $line 0]
>                        switch -- $op {
>                        { } {set tags {}}
>

Please ignore this proposal. I have a better solution in the pipe
(which solves both problems reported here).

Bert

^ permalink raw reply

* Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags
From: Bert Wesarg @ 2010-12-06 21:28 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Shawn O. Pearce, git, Bert Wesarg, Gustaf Hendeby
In-Reply-To: <AANLkTimz-XZQzTygKxQDJ+E6ZJm1+8aZNuKfZ6-AwQh3@mail.gmail.com>

On Fri, Dec 3, 2010 at 14:34, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> [ Adding Gustaf Hendeby, the author of the first patch to support type changes ]
>
> On Tue, Nov 30, 2010 at 23:21, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> This covers also the case for newly added files in the index. Like this:
>>
>>    echo bar >foo
>>    git add foo
>>    rm foo
>>    ln -s bar foo
>>
>> This will result in an state of AT. And for cases where the type change is
>> staged, and the new type was modified after the staging. Like this (cont.):
>>
>>    git add foo
>>    git commit -mfoo
>>    rm foo
>>    echo bar >foo
>>    git add foo
>>    echo baz >foo
>>
>> Will result in an state of TM for foo.

This patch is incomplete. There are more places where the new AT and
TM states needs to be handled. Please wait for a re-roll.

Bert

^ permalink raw reply

* Re: [PATCH] git-gui: handle symlink replaced by file
From: Bert Wesarg @ 2010-12-06 21:26 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Git Mailing List
In-Reply-To: <AANLkTi=P+sKzYSkeS2-N+DerP3zdRgrDnuNuXbK0O89s@mail.gmail.com>

On Wed, Nov 3, 2010 at 21:07, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Thu, Oct 28, 2010 at 14:27, Pat Thoyts
> <patthoyts@users.sourceforge.net> wrote:
>> This patch just handles the second segment without generating the error
>> really. It doesn't attempt to do any pretty output.
>
> Thanks for the patch. I haven't test it yet. Actually I can't find
> documentation, that git outputs two diffs when the path changes the
> type. And I have no idea how to present this in git gui.

I have a better fix for this. But haven't the time to send it yet.

Bert

>
> Bert
>

^ permalink raw reply

* Re: [PATCH] Fix use of hunk tag for non-hunk content.
From: Pat Thoyts @ 2010-12-06 21:25 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git
In-Reply-To: <02730a5b5e904409da58c7f5ebe40e16e7adc1f1.1291019649.git.bert.wesarg@googlemail.com>

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>The hunk tag d_@ lost its blue forground color in "apply color information
>from git diff output" (2010-10-22, 8f85599). But this tag was also used
>for non-hunk content like untracked file mime types or git submodules.
>
>Introduce a new tag for this type of content which has the blue forground
>again.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> git-gui.sh   |    2 ++
> lib/diff.tcl |   14 +++++++-------
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
>diff --git a/git-gui.sh b/git-gui.sh
>index 38362fa..c85a53c 100755
>--- a/git-gui.sh
>+++ b/git-gui.sh
>@@ -3331,6 +3331,8 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
> }
> $ui_diff tag configure clr1 -font font_diffbold
> 
>+$ui_diff tag conf d_info -foreground blue -font font_diffbold
>+
> $ui_diff tag conf d_cr -elide true
> $ui_diff tag conf d_@ -font font_diffbold
> $ui_diff tag conf d_+ -foreground {#00a000}
>diff --git a/lib/diff.tcl b/lib/diff.tcl
>index 8fea947..8435635 100644
>--- a/lib/diff.tcl
>+++ b/lib/diff.tcl
>@@ -208,32 +208,32 @@ proc show_other_diff {path w m cont_info} {
> 			$ui_diff insert end [append \
> 				"* " \
> 				[mc "Git Repository (subproject)"] \
>-				"\n"] d_@
>+				"\n"] d_info
> 		} elseif {![catch {set type [exec file $path]}]} {
> 			set n [string length $path]
> 			if {[string equal -length $n $path $type]} {
> 				set type [string range $type $n end]
> 				regsub {^:?\s*} $type {} type
> 			}
>-			$ui_diff insert end "* $type\n" d_@
>+			$ui_diff insert end "* $type\n" d_info
> 		}
> 		if {[string first "\0" $content] != -1} {
> 			$ui_diff insert end \
> 				[mc "* Binary file (not showing content)."] \
>-				d_@
>+				d_info
> 		} else {
> 			if {$sz > $max_sz} {
> 				$ui_diff insert end [mc \
> "* Untracked file is %d bytes.
> * Showing only first %d bytes.
>-" $sz $max_sz] d_@
>+" $sz $max_sz] d_info
> 			}
> 			$ui_diff insert end $content
> 			if {$sz > $max_sz} {
> 				$ui_diff insert end [mc "
> * Untracked file clipped here by %s.
> * To see the entire file, use an external editor.
>-" [appname]] d_@
>+" [appname]] d_info
> 			}
> 		}
> 		$ui_diff conf -state disabled
>@@ -442,10 +442,10 @@ proc read_diff {fd conflict_size cont_info} {
> 		} elseif {$is_submodule_diff} {
> 			if {$line == ""} continue
> 			if {[regexp {^Submodule } $line]} {
>-				set tags d_@
>+				set tags d_info
> 			} elseif {[regexp {^\* } $line]} {
> 				set line [string replace $line 0 1 {Submodule }]
>-				set tags d_@
>+				set tags d_info
> 			} else {
> 				set op [string range $line 0 2]
> 				switch -- $op {

Looks great. Thank you.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply

* Re: [PATCH] git-gui: Fix use of renamed tag.
From: Pat Thoyts @ 2010-12-06 21:20 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git
In-Reply-To: <c24527d4bb9cdc1f72f27c2154d0320ee5579fa1.1291018765.git.bert.wesarg@googlemail.com>

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>The d======= was renamed to d= in 4590307.
>
>Fix this.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> lib/diff.tcl |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/lib/diff.tcl b/lib/diff.tcl
>index 8fea947..7b1fddf 100644
>--- a/lib/diff.tcl
>+++ b/lib/diff.tcl
>@@ -122,22 +122,22 @@ proc show_unmerged_diff {cont_info} {
> 	if {$merge_stages(2) eq {}} {
> 		set is_conflict_diff 1
> 		lappend current_diff_queue \
>-			[list [mc "LOCAL: deleted\nREMOTE:\n"] d======= \
>+			[list [mc "LOCAL: deleted\nREMOTE:\n"] d= \
> 			    [list ":1:$current_diff_path" ":3:$current_diff_path"]]
> 	} elseif {$merge_stages(3) eq {}} {
> 		set is_conflict_diff 1
> 		lappend current_diff_queue \
>-			[list [mc "REMOTE: deleted\nLOCAL:\n"] d======= \
>+			[list [mc "REMOTE: deleted\nLOCAL:\n"] d= \
> 			    [list ":1:$current_diff_path" ":2:$current_diff_path"]]
> 	} elseif {[lindex $merge_stages(1) 0] eq {120000}
> 		|| [lindex $merge_stages(2) 0] eq {120000}
> 		|| [lindex $merge_stages(3) 0] eq {120000}} {
> 		set is_conflict_diff 1
> 		lappend current_diff_queue \
>-			[list [mc "LOCAL:\n"] d======= \
>+			[list [mc "LOCAL:\n"] d= \
> 			    [list ":1:$current_diff_path" ":2:$current_diff_path"]]
> 		lappend current_diff_queue \
>-			[list [mc "REMOTE:\n"] d======= \
>+			[list [mc "REMOTE:\n"] d= \
> 			    [list ":1:$current_diff_path" ":3:$current_diff_path"]]
> 	} else {
> 		start_show_diff $cont_info

Looks correct. Thank you.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply

* [PATCH] logging branch deletion to help recovering from mistakes
From: Junio C Hamano @ 2010-12-06 21:16 UTC (permalink / raw)
  To: git

This adds core.logrefdeletion configuration variable (enabled by default
in a repository with a work tree, just like core.logallrefupdates), and
logs deletion of refs via "update-ref -d", "branch -d", etc.

"git branch" learns a new "--list-deleted" option to help users view the
names of branches and the commit objects that were at the tip of them when
the branches were deleted.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * This recently came up at $dayjob.  The new option is not '--undelete'
   and this is deliberate, as we do not have any information other than
   the tip of the branch to recreate tracking and other frills.

 Documentation/config.txt             |    6 +
 Documentation/git-branch.txt         |    6 +
 builtin/branch.c                     |   21 ++++-
 cache.h                              |    1 +
 config.c                             |    5 +
 environment.c                        |    1 +
 refs.c                               |  167 +++++++++++++++++++++++++---------
 refs.h                               |    2 +
 t/t1400-update-ref.sh                |   53 ++++++++++-
 t/t7701-repack-unpack-unreachable.sh |    4 +
 10 files changed, 219 insertions(+), 47 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index d82c0da..bdf90eb 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -351,6 +351,12 @@ This value is true by default in a repository that has
 a working directory associated with it, and false by
 default in a bare repository.
 
+core.logRefDeletion::
+	Enable logging of eletion of refs (e.g. branches), allowing `git
+	branch --list-deleted` to help you recover branches lost by
+	running `git branch -d` by mistake.  This is enabled in a
+	repository that has a working tree associated with it by default.
+
 core.repositoryFormatVersion::
 	Internal variable identifying the repository format and layout
 	version.
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 1940256..07ec47b 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -14,6 +14,7 @@ SYNOPSIS
 'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
 'git branch' (-m | -M) [<oldbranch>] <newbranch>
 'git branch' (-d | -D) [-r] <branchname>...
+'git branch' --list-deleted [<pattern>...]
 
 DESCRIPTION
 -----------
@@ -70,6 +71,11 @@ OPTIONS
 -D::
 	Delete a branch irrespective of its merged status.
 
+--list-deleted::
+	List names of recently deleted branches together with the object
+	names of the commits that were at the tip of them.  Glob patterns
+	can be used to limit the branches that are shown.
+
 -l::
 	Create the branch's reflog.  This activates recording of
 	all changes made to the branch ref, enabling use of date
diff --git a/builtin/branch.c b/builtin/branch.c
index 87976f0..68604c2 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -15,6 +15,7 @@
 #include "branch.h"
 #include "diff.h"
 #include "revision.h"
+#include "string-list.h"
 
 static const char * const builtin_branch_usage[] = {
 	"git branch [options] [-r | -a] [--merged | --no-merged]",
@@ -144,6 +145,19 @@ static int branch_merged(int kind, const char *name,
 	return merged;
 }
 
+static int show_deleted(struct string_list_item *item, void *cb_data)
+{
+	printf("%s %s\n", (char *)item->util, item->string);
+	return 0;
+}
+
+static int list_deleted_branches(const char **argv)
+{
+	struct string_list *deleted = list_deleted_refs("refs/heads/", argv);
+	for_each_string_list(deleted, show_deleted, NULL);
+	return 0;
+}
+
 static int delete_branches(int argc, const char **argv, int force, int kinds)
 {
 	struct commit *rev, *head_rev = NULL;
@@ -612,7 +626,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
 
 int cmd_branch(int argc, const char **argv, const char *prefix)
 {
-	int delete = 0, rename = 0, force_create = 0;
+	int delete = 0, rename = 0, force_create = 0, list_deleted = 0;
 	int verbose = 0, abbrev = DEFAULT_ABBREV, detached = 0;
 	int reflog = 0;
 	enum branch_track track;
@@ -652,6 +666,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		OPT_BIT('M', NULL, &rename, "move/rename a branch, even if target exists", 2),
 		OPT_BOOLEAN('l', NULL, &reflog, "create the branch's reflog"),
 		OPT_BOOLEAN('f', "force", &force_create, "force creation (when already exists)"),
+		OPT_BOOLEAN(0, "list-deleted", &list_deleted, "list deleted branches"),
 		{
 			OPTION_CALLBACK, 0, "no-merged", &merge_filter_ref,
 			"commit", "print only not merged branches",
@@ -689,11 +704,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
 	argc = parse_options(argc, argv, prefix, options, builtin_branch_usage,
 			     0);
-	if (!!delete + !!rename + !!force_create > 1)
+	if (!!list_deleted + !!delete + !!rename + !!force_create > 1)
 		usage_with_options(builtin_branch_usage, options);
 
 	if (delete)
 		return delete_branches(argc, argv, delete > 1, kinds);
+	else if (list_deleted)
+		return list_deleted_branches(argv);
 	else if (argc == 0)
 		return print_ref_list(kinds, detached, verbose, abbrev, with_commit);
 	else if (rename && (argc == 1))
diff --git a/cache.h b/cache.h
index 2ef2fa3..0a82612 100644
--- a/cache.h
+++ b/cache.h
@@ -537,6 +537,7 @@ extern int ignore_case;
 extern int assume_unchanged;
 extern int prefer_symlink_refs;
 extern int log_all_ref_updates;
+extern int log_ref_deletion;
 extern int warn_ambiguous_refs;
 extern int shared_repository;
 extern const char *apply_default_whitespace;
diff --git a/config.c b/config.c
index 4b0a820..cfa162a 100644
--- a/config.c
+++ b/config.c
@@ -509,6 +509,11 @@ static int git_default_core_config(const char *var, const char *value)
 		return 0;
 	}
 
+	if (!strcmp(var, "core.logrefdeletion")) {
+		log_ref_deletion = git_config_bool(var, value);
+		return 0;
+	}
+
 	if (!strcmp(var, "core.warnambiguousrefs")) {
 		warn_ambiguous_refs = git_config_bool(var, value);
 		return 0;
diff --git a/environment.c b/environment.c
index 2d0c315..12166d9 100644
--- a/environment.c
+++ b/environment.c
@@ -20,6 +20,7 @@ int assume_unchanged;
 int prefer_symlink_refs;
 int is_bare_repository_cfg = -1; /* unspecified */
 int log_all_ref_updates = -1; /* unspecified */
+int log_ref_deletion = -1; /* unspecified */
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 const char *git_commit_encoding;
diff --git a/refs.c b/refs.c
index e3c0511..afdd634 100644
--- a/refs.c
+++ b/refs.c
@@ -3,11 +3,14 @@
 #include "object.h"
 #include "tag.h"
 #include "dir.h"
+#include "string-list.h"
 
 /* ISSYMREF=01 and ISPACKED=02 are public interfaces */
 #define REF_KNOWS_PEELED 04
 #define REF_BROKEN 010
 
+#define BRANCH_DELETION_LOG "DELETED-REFS"
+
 struct ref_list {
 	struct ref_list *next;
 	unsigned char flag; /* ISSYMREF? ISPACKED? */
@@ -1137,44 +1140,6 @@ static int repack_without_ref(const char *refname)
 	return commit_lock_file(&packlock);
 }
 
-int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
-{
-	struct ref_lock *lock;
-	int err, i = 0, ret = 0, flag = 0;
-
-	lock = lock_ref_sha1_basic(refname, sha1, 0, &flag);
-	if (!lock)
-		return 1;
-	if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) {
-		/* loose */
-		const char *path;
-
-		if (!(delopt & REF_NODEREF)) {
-			i = strlen(lock->lk->filename) - 5; /* .lock */
-			lock->lk->filename[i] = 0;
-			path = lock->lk->filename;
-		} else {
-			path = git_path("%s", refname);
-		}
-		err = unlink_or_warn(path);
-		if (err && errno != ENOENT)
-			ret = 1;
-
-		if (!(delopt & REF_NODEREF))
-			lock->lk->filename[i] = '.';
-	}
-	/* removing the loose one could have resurrected an earlier
-	 * packed one.  Also, if it was not loose we need to repack
-	 * without it.
-	 */
-	ret |= repack_without_ref(refname);
-
-	unlink_or_warn(git_path("logs/%s", lock->ref_name));
-	invalidate_cached_refs();
-	unlock_ref(lock);
-	return ret;
-}
-
 /*
  * People using contrib's git-new-workdir have .git/logs/refs ->
  * /some/other/path/.git/logs/refs, and that may live on another device.
@@ -1361,11 +1326,13 @@ int log_ref_setup(const char *ref_name, char *logfile, int bufsize)
 	int logfd, oflags = O_APPEND | O_WRONLY;
 
 	git_snpath(logfile, bufsize, "logs/%s", ref_name);
-	if (log_all_ref_updates &&
-	    (!prefixcmp(ref_name, "refs/heads/") ||
-	     !prefixcmp(ref_name, "refs/remotes/") ||
-	     !prefixcmp(ref_name, "refs/notes/") ||
-	     !strcmp(ref_name, "HEAD"))) {
+	if ((log_all_ref_updates &&
+	     (!prefixcmp(ref_name, "refs/heads/") ||
+	      !prefixcmp(ref_name, "refs/remotes/") ||
+	      !prefixcmp(ref_name, "refs/notes/") ||
+	      !strcmp(ref_name, "HEAD"))) ||
+	    (log_ref_deletion &&
+	     !strcmp(ref_name, BRANCH_DELETION_LOG))) {
 		if (safe_create_leading_directories(logfile) < 0)
 			return error("unable to create directory for %s",
 				     logfile);
@@ -1407,6 +1374,8 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
 
 	if (log_all_ref_updates < 0)
 		log_all_ref_updates = !is_bare_repository();
+	if (log_ref_deletion < 0)
+		log_ref_deletion = !is_bare_repository();
 
 	result = log_ref_setup(ref_name, log_file, sizeof(log_file));
 	if (result)
@@ -1432,6 +1401,118 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
 	return 0;
 }
 
+struct filter_deleted {
+	const char *pfx;
+	const char **pattern;
+	size_t pfxlen;
+	struct string_list *list;
+};
+
+static int collect_deleted(unsigned char *osha1, unsigned char *nsha1,
+			   const char *ident,
+			   unsigned long timestamp, int tz,
+			   const char *msg, void *cb_data)
+{
+	struct filter_deleted *filter = cb_data;
+	struct string_list_item *item;
+	const char *nameloc;
+	char *namebody;
+	char namebody_buf[1024];
+	size_t namebodylen;
+
+	if (prefixcmp(msg, "delete ") ||
+	    memcmp(msg + 7, filter->pfx, filter->pfxlen) ||
+	    !is_null_sha1(nsha1))
+		return 0;
+	nameloc = msg + 7 + filter->pfxlen;
+	namebodylen = strlen(nameloc); /* counts final LF */
+	if (!namebodylen || nameloc[namebodylen - 1] != '\n')
+		return 0;
+	if (sizeof(namebody_buf) <= namebodylen)
+		namebody = xmalloc(namebodylen);
+	else
+		namebody = namebody_buf;
+	memcpy(namebody, nameloc, namebodylen);
+	namebody[namebodylen - 1] = '\0';
+	if (filter->pattern[0]) {
+		int i, matches;
+		for (i = matches = 0; !matches && filter->pattern[i]; i++)
+			if (fnmatch(filter->pattern[i], namebody, 0))
+				matches = 1;
+		if (!matches)
+			goto free_return;
+	}
+	item = string_list_insert(filter->list, namebody);
+	if (!item->util)
+		item->util = xmalloc(41);
+	strcpy(item->util, sha1_to_hex(osha1));
+free_return:
+	if (namebody != namebody_buf)
+		free(namebody);
+	return 0;
+}
+
+struct string_list *list_deleted_refs(const char *pfx, const char **pattern)
+{
+	struct filter_deleted filter = { pfx, pattern };
+	filter.list = xcalloc(1, sizeof(*(filter.list)));
+	filter.list->strdup_strings = 1;
+	filter.pfxlen = strlen(pfx);
+
+	for_each_reflog_ent(BRANCH_DELETION_LOG, collect_deleted, &filter);
+	return filter.list;
+}
+
+int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
+{
+	struct ref_lock *lock;
+	int err, i = 0, ret = 0, flag = 0;
+	struct strbuf logmsg = STRBUF_INIT;
+
+	lock = lock_ref_sha1_basic(refname, sha1, 0, &flag);
+	if (!lock)
+		return 1;
+	if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) {
+		/* loose */
+		const char *path;
+
+		if (!(delopt & REF_NODEREF)) {
+			i = strlen(lock->lk->filename) - 5; /* .lock */
+			lock->lk->filename[i] = 0;
+			path = lock->lk->filename;
+		} else {
+			path = git_path("%s", refname);
+		}
+		err = unlink_or_warn(path);
+		if (err && errno != ENOENT)
+			ret = 1;
+
+		if (!(delopt & REF_NODEREF))
+			lock->lk->filename[i] = '.';
+	}
+	/*
+	 * removing the loose one could have resurrected an earlier
+	 * packed one.  Also, if it was not loose we need to repack
+	 * without it.
+	 */
+	ret |= repack_without_ref(refname);
+
+	unlink_or_warn(git_path("logs/%s", lock->ref_name));
+	invalidate_cached_refs();
+
+	strbuf_addf(&logmsg, "delete %s", refname);
+	if (log_ref_write(BRANCH_DELETION_LOG,
+			  lock->old_sha1, null_sha1, logmsg.buf))
+		/*
+		 * there isn't much we can do at this point upon
+		 * failing to record the branch deletion, and an error
+		 * messages have been already issued.
+		 */
+		;
+	unlock_ref(lock);
+	return ret;
+}
+
 static int is_branch(const char *refname)
 {
 	return !strcmp(refname, "HEAD") || !prefixcmp(refname, "refs/heads/");
diff --git a/refs.h b/refs.h
index 5e7a9a5..9fcf7ac 100644
--- a/refs.h
+++ b/refs.h
@@ -87,6 +87,8 @@ typedef int each_reflog_ent_fn(unsigned char *osha1, unsigned char *nsha1, const
 int for_each_reflog_ent(const char *ref, each_reflog_ent_fn fn, void *cb_data);
 int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long, void *cb_data);
 
+struct string_list *list_deleted_refs(const char *prefix, const char **pattern);
+
 /*
  * Calls the specified function for each reflog file until it returns nonzero,
  * and returns the value
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 54ba3df..ad9f461 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -9,6 +9,7 @@ test_description='Test git update-ref and basic ref logging'
 Z=0000000000000000000000000000000000000000
 
 test_expect_success setup '
+	git config core.logrefdeletion false &&
 
 	for name in A B C D E F
 	do
@@ -38,7 +39,8 @@ test_expect_success "fail to delete $m with stale ref" '
 '
 test_expect_success "delete $m" '
 	git update-ref -d $m $B &&
-	! test -f .git/$m
+	! test -f .git/$m &&
+	! test -f .git/logs/DELETED-REFS
 '
 rm -f .git/$m
 
@@ -46,7 +48,8 @@ test_expect_success "delete $m without oldvalue verification" "
 	git update-ref $m $A &&
 	test $A = \$(cat .git/$m) &&
 	git update-ref -d $m &&
-	! test -f .git/$m
+	! test -f .git/$m &&
+	! test -f .git/logs/DELETED-REFS
 "
 rm -f .git/$m
 
@@ -285,4 +288,50 @@ test_expect_success \
 	'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' \
 	'test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")'
 
+test_expect_success 'reflog for deletion' '
+	git config core.logrefdeletion yes &&
+
+	git branch frotz HEAD &&
+	git branch nitfol $A &&
+	git branch xyzzy $B &&
+
+	git branch -d frotz &&
+	git branch -D nitfol &&
+	git update-ref -d refs/heads/xyzzy &&
+	{
+		echo "$(git rev-parse HEAD) frotz"
+		echo "$A nitfol"
+		echo "$B xyzzy"
+	} >expect &&
+	git branch --list-deleted >actual &&
+	test_cmp expect actual
+'
+
+test_expect_success 'reflog for deletion disabled by default in a bare repo' '
+	rm -fr test &&
+	mkdir test &&
+	(
+		cd test && git --bare init &&
+		git fetch .. HEAD:refs/heads/master HEAD:refs/heads/slave &&
+		git update-ref -d refs/heads/slave &&
+		git branch --list-deleted >actual &&
+		>expect &&
+		test_cmp expect actual
+	)
+'
+
+test_expect_success 'reflog for deletion can be enabled in a bare repo' '
+	rm -fr test &&
+	mkdir test &&
+	(
+		cd test && git --bare init &&
+		git config core.logrefdeletion yes &&
+		git fetch .. HEAD:refs/heads/master HEAD:refs/heads/slave &&
+		git update-ref -d refs/heads/slave &&
+		git branch --list-deleted >actual &&
+		echo "$(git rev-parse master) slave" >expect &&
+		test_cmp expect actual
+	)
+'
+
 test_done
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 200ab61..f6209d2 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -9,6 +9,10 @@ csha1=
 tsha1=
 
 test_expect_success '-A with -d option leaves unreachable objects unpacked' '
+	# The test expects branch removal to lose the last reference to
+	# lost objects.  Disable branch deletion log to achieve this.
+	git config core.logrefdeletion false &&
+
 	echo content > file1 &&
 	git add . &&
 	test_tick &&

^ permalink raw reply related

* Re: git diff --summary only seems to work when combined with --stat
From: Jonathan Nieder @ 2010-12-06 21:03 UTC (permalink / raw)
  To: demerphq; +Cc: Git
In-Reply-To: <AANLkTimCAy8kcQaKNaxz4UJp2ZB=_HeRMmeaQ5ZHNV4g@mail.gmail.com>

Hi Yves,

demerphq wrote:

> It seems like the --summary option only works in combination --stat.
> 
> It doesn't seem to work if I use it by itself, nor in combination with
> --name-status or --num-stat. And depending on the order, it either
> does nothing, or causes a usage note.

It is tricky, but as you noticed --summary is not actually about the
diffstat.  --summary affects the output summarizing new files and
renamed files.

Example:

	$ git diff --summary v1.7.2..v1.7.3
	delete mode 100644 Documentation/RelNotes-1.5.0.1.txt
	delete mode 100644 Documentation/RelNotes-1.5.0.2.txt
	[...]

> $ git diff --name-status --sumary HEAD^
> usage: git diff <options> <rev>{0,2} -- <path>*

There is an 'm' missing here. :)

Hope that helps,
Jonathan

^ permalink raw reply

* Re: git-gui: commit message box doesn't respond to enter (only return)
From: Pat Thoyts @ 2010-12-06 20:55 UTC (permalink / raw)
  To: Konstantin Khomoutov; +Cc: Jonathan Nieder, git, David Laban
In-Reply-To: <20101126232825.GE3264@localhost.localdomain>

Konstantin Khomoutov <flatworm@users.sourceforge.net> writes:

>On Fri, Nov 26, 2010 at 02:38:55PM -0600, Jonathan Nieder wrote:
>
>> David Laban wrote at http://bugs.debian.org/605041:
>> 
>> > Package: git-gui
>> > Version: 1:1.7.2.3-2
>> > Severity: minor
>> >
>> > If I click into the messagebox and hit enter, nothing happens.
>> >
>> > This is annoying because if I'm adding a new paragraph to my commit message, 
>> > I will often do <click> <enter><enter> <start typing as normal>
>> >
>> > Don't ask me why I do this. I think enter is a lighter/easier to press
>> > key than return, and is also on the path that my hand takes between the mouse
>> > and the rest of the keyboard.
>> >
>> > I have also provisionally reported the following bug in tk, but I feel like
>> > a bit of a n00b for doing so.
>> >
>> > http://sf.net/tracker/?func=detail&aid=3119824&group_id=12997&atid=112997
>> 
>> I can't reproduce this because this laptop does not have a distinct
>> "numpad enter" key.
>I've tested it on Debian Squeeze and added another comment on the
>upstream bug report. In short: KP_Enter is not bound to any action in
>Tk text widgets in X11, at least in 8.5.9.
>
>But git-gui can be trivially patched to support this; that would be a
>one-lineer. So if it is desired and will be accepted, I could prepare a
>patch.
>

I've no problem with that. On unix the messagebox bindings are applied
directly to the dialog window (.__tk__messagebox) and it does include
Dialog in the bindtags so you could use
 bind Dialog <Key-KP_Enter> { .... }
except that might affect other dialogs too. That might not be a
problem. On Windows the messagebox is native so the bindings there are
whatever are standard.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply

* git diff --summary only seems to work when combined with --stat
From: demerphq @ 2010-12-06 20:55 UTC (permalink / raw)
  To: Git

Hi,

It seems like the --summary option only works in combination --stat.

It doesn't seem to work if I use it by itself, nor in combination with
--name-status or --num-stat. And depending on the order, it either
does nothing, or causes a usage note.

Is this intentional? If so, could it be reconsidered?  At the very
least in combination with --name-status and by itself, I can kind of
understand it not working with --numstat

Ive tested with two gits, and it seems to be the same in both:

git version 1.7.2.1 and git version 1.7.3.2.168.gd6b63

Cheers,
yves

$ git diff --summary --stat HEAD^
 somefile |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
$ git diff --summary HEAD^
$ git diff --summary --numstat HEAD^
12      2       somefile
$ git diff --summary --name-status HEAD^
M       somefile
$ git diff --name-status --sumary HEAD^
usage: git diff <options> <rev>{0,2} -- <path>*
$ git diff --numstat --sumary HEAD^
usage: git diff <options> <rev>{0,2} -- <path>*



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

^ permalink raw reply

* git fetch vs push, git am questions
From: Konstantin Kivi @ 2010-12-06 20:27 UTC (permalink / raw)
  To: git

HI all
I honestly tried to find answers in various docs/books about git and failed, so I have to ask here.
 
1) Is it possible to achieve the same result with git fetch, as I have with git push. I have cloned a bare repository (2) from my repository (1) and 
I want fetch made in (2) get all info contained in (1) . I talk only about 'master' here. git push from (1) to (2) does the job, but git fetch in (1) updates only origin/master, and not master.
I also found that there is a notions of current branch in bare repository (master in my case), that stops my experiments of deleting master and making new master out of origin/master.
How can I change current branch in bare repositry?
 
2) I read that git rebase used 'git am' internally. How can  force git am/apply to create conflicts like rebase does in form
 
<<<<<<old
dksjfd
========
>>>>>jfkjdfkd
 
instead of *.rej files 

Best regard, Konstantin

^ permalink raw reply

* Re: [PATCH] t9143: do not fail when unhandled.log.gz is not created
From: Eric Wong @ 2010-12-06 19:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Torsten Bögershausen
In-Reply-To: <4CFA27E0.8070308@web.de>

Torsten Bögershausen <tboegi@web.de> wrote:
> Commit df73af5f66 is does not let the test case fail,
> when Compress::Zlib is missing.
> But:
> On a MacOS X 10.6 system with missing Compress::Zlib
> using svn version 1.6.5 (r38866) the gz file is created.
> Solution:
> Check for the existance of the unhandled.log.gz file.

I wonder if your system could have multiple perl installations and
git-svn is calling one while the shell scripts are calling another.
I'm not sure if there is another way the gz file could be created while
Compress::Zlib is missing.

> Signed-off-by: Torsten Bögershausen <tboegi@web.de>

Torsten Bögershausen wrote in <4CFA27DD.7030105@web.de>:
> Now we do not depend on internal implementation details of svn.
> And the code is 3% easier to understand :-)

I agree on this point completely

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  t/t9143-git-svn-gc.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh
> index 337ea59..8a95d78 100755
> --- a/t/t9143-git-svn-gc.sh
> +++ b/t/t9143-git-svn-gc.sh
> @@ -37,7 +37,7 @@ test_expect_success 'git svn gc runs' 'git svn gc'
>   test_expect_success 'git svn index removed' '! test -f  
> .git/svn/refs/remotes/git-svn/index'
>  -if perl -MCompress::Zlib -e 0 2>/dev/null
> +if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
>  then
>  	test_expect_success 'git svn gc produces a valid gzip file' '
>  		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
> -- 

^ permalink raw reply

* Re: path/to/some/file: needs update
From: Patrick Doyle @ 2010-12-06 19:23 UTC (permalink / raw)
  To: Neal Kreitzinger; +Cc: git
In-Reply-To: <idjd25$ajd$1@dough.gmane.org>

On Mon, Dec 6, 2010 at 2:19 PM, Neal Kreitzinger <neal@rsss.com> wrote:
> "Neal Kreitzinger" <neal@rsss.com> wrote in message
>> Hi, Patrick,
>>
>> There isn't an RHEL or EPEL rpm for a current version of git.  What you'll
>> need to do is build git yourself using the tarball download from git.  The
>
> v/r,
> Neal
Hi Neal,
Thanks for the tip.  I won't spend too much time looking for a newer
RPM.  As you indicated, it should be pretty easy to install from
source.

Thanks.

--wpd

^ permalink raw reply

* Re: path/to/some/file: needs update
From: Neal Kreitzinger @ 2010-12-06 19:19 UTC (permalink / raw)
  To: git
In-Reply-To: <idjc9t$6hv$1@dough.gmane.org>

"Neal Kreitzinger" <neal@rsss.com> wrote in message 
news:idjc9t$6hv$1@dough.gmane.org...
> >"Patrick Doyle" <wpdster@gmail.com> wrote in message 
> >news:AANLkTinFHFzjLNb5PpoH8WG_3gHpo4LaZaUOYX->=PFYN@mail.gmail.com...
>>On Fri, Dec 3, 2010 at 1:58 PM, Matthieu Moy
>><Matthieu.Moy@grenoble-inp.fr> wrote:
>>> Patrick Doyle <wpdster@gmail.com> writes:
>>>
>>>> path/to/some/file: needs update.
>>>>
>>>> Then things got worse... one of the messages said:
>>>>
>>>> error: Entry 'path/to/some/binaryfile' not uptodate. Cannot merge
>>>
>>> Which commands triggered these messages? Which version of Git?
>>>
>>> AFAICT, these messages never appear anymore in normal (porcelain) use
>>> in recent Gits.
>>Ahhh... that's something.
>>
>>I just checked.  The box they  were using is an RHEL 5 box that has
>>1.5.5.6 installed on it.  Perhaps it's time to upgrade their git.
>>I'll go see what repo I need to add to RHEL to get a more recent git.
>>
>>Thanks.
>>
>>--wpd
>
> Hi, Patrick,
>
> There isn't an RHEL or EPEL rpm for a current version of git.  What you'll 
> need to do is build git yourself using the tarball download from git.  The 
> make file provided by git has worked great for me.  Here are my 
> instructions on how I did it.  They are written for a linux newbie (me) 
> and I've used them for several git installs/upgrades and my 
> linux-illiterate coworker has successfully used them too (with me looking 
> over his shoulder).  Because I've used it for several installs, some 
> different git version numbers are in the detailed notes.  I've left them 
> there for precision.  However, in my experience the steps were the same 
> for these differnt git versions, so you can pretend they are for whatever 
> git version you end up chosing to install. We have dozens of git repos in 
> production being used for productional development, and several servers 
> with git installed, so hopefully these instructions should work for you 
> too:
>
> "How to install git on Red Hat, RHEL"
> NOTE:  This only includes what is needed to get command line git, gitk, 
> and git gui working.  It does NOT include the extra stuff needed to get 
> gitweb, or git documentation (manpages, html, etc) working.
>
> GIT INSTALL, PART 1.  INSTALL GIT.
> Compile Git manually because Red Hat's Git version is obsolete.
>
> 1.  Choose a git version.
> 1.1  Review the git release notes: 
> http://www.kernel.org/pub/software/scm/git/docs/  The last minor revision 
> of major release is the usually the safest because many bugfixes have been 
> made.  A version that has a corresponding git manual release number is 
> also preferable.  Usually the last revision of a major release also has a 
> corresponding git manual release - this is ideal.
> 2.  Download git sourcecode.
> 2.1  Use the git0 login for the source download:   (note:  'git0' is 
> whatever login you have allocated as the 'git admin' signon.)
> [git0]$ cd /home/git0
> 2.2  Create a specific folder for the git source:
> [git0]$ mkdir git-source
> [git0]$ cd /home/git0/git-source
> 2.3  Review the git source tar files located on: 
> http://www.kernel.org/pub/software/scm/git/  and locate the tar for your 
> chosen version.
> 2.4  Copy and paste the url into the wget command, and then copy and paste 
> (append) the tar filename to the end of the wget command:
> [git0]$ wget http://kernel.org/pub/software/scm/git/git-1.6.3.4.tar.gz 
> where 1.6.3.4 is your chosen git version.
> 2.5  Untar the git sourcecode:
> [git0]$ tar xzf git-1.6.3.4.tar.gz  (where 1.6.3.4 is whatever git version 
> you chose to install.)
> [git0]$ cd git-1.6.3.4  (the tar command created this directory for you.)
> [git0]$ ls -la  (verify the contents.)
> 3.  Research Git Dependencies.  Validate prerequisite packages and install 
> if necessary.
> 3.1  Read INSTALL file of git source release to obtain the current list of 
> prerequisite packages.  The development version of these packages is 
> required or preferred in order to perform a compile of git.  Development 
> packages have the same name but are suffixed with "-devel", e.g. 
> zlib-devel instead of zlib.  The regular non-devel version of the package 
> IS STILL REQUIRED, e.g. zlib-devel AND zlib.
> 3.1.1  [git0]$ cat /home/git0/git-source/git-1.6.3.4/INSTALL
> 4.  Resolve Git Dependencies.
> Validate prerequisite packages and install if necessary.  The following is 
> the dependency list from the git-1.6.3.4 INSTALL file:
> REMINDER:
> READ YOUR INSTALL FILE FROM GIT.  DO NOT RELY SOLELY ON THIS IN-HOUSE 
> DOCUMENT.
> 4.1  "zlib", the compression library. Git won't build without it.
> 4.1.1  [neal]$ yum list zlib
> 4.1.2  [neal]$ yum list zlib-devel
> 4.2  "openssl".  Unless you specify otherwise, you'll get the SHA1 library 
> from here.  If you don't have openssl, you can use one of the SHA1 
> libraries that come with git (git includes the one from Mozilla, and has 
> its own PowerPC and ARM optimized ones too - see the Makefile).
> 4.2.1  [neal]$ yum list openssl
> 4.2.2  [neal]$ yum list openssl-devel
> 4.3  libcurl library; git-http-fetch and git-fetch use them.  You might 
> also want the "curl" executable for debugging purposes. If you do not use 
> http transfer, you are probably OK if you do not have them.
> NOTE: I installed security updates, 'yum update --security' to remediate 
> out-of-date curl packages.
> NOTE:  to get yum security plugin:
> $ yum install yum-security.  (allows security updates only.)
> 4.3.1  [neal]$ yum list curl  (Red Hat calls it curl instead of libcurl.)
> 4.3.2  [neal]$ yum list curl-devel  (Red Hat calls it curl-devel instead 
> of libcurl-devel.)
> 4.4  expat library; git-http-push uses it for remote lock management over 
> DAV.  Similar to "curl" above, this is optional.
> 4.4.1  [neal]$ yum list expat
> 4.4.2  [neal]$ yum list expat-devel
> 4.5  "wish", the Tcl/Tk windowing shell is used in gitk to show the 
> history graphically, and in git-gui.
> 4.5.1  [neal]$ yum list tcl
> 4.5.2  [neal]$ yum list tcl-devel
> 4.5.3  [neal]$ yum list tk
> 4.5.4  [neal]$ yum list tk-devel
> 4.5.5  [neal]$ yum list xdg-utils  (development version "-devel" is not 
> needed for xdg-utils.)
> 4.6  "ssh" is used to push and pull over the net.
> 4.6.1  There is no package to validate.  In Red Hat this is part of the 
> OS.
> 4.7  "perl" and POSIX-compliant shells are needed to use most of the 
> bare-bones Porcelainish scripts.
> 4.7.1  [neal]$ yum list perl  (Perl is a programming language.  There is 
> no "-devel" version required.)
> 5.  Compile Git.
> 5.1  Perform the Git installation process from the 
> /home/git0/git-source/git-1.6.3.4 directory:
> [neal]$ cd /home/git0/git-source/git-1.6.3.4
> 5.2  READ THE "Makefile" LOCATED IN THE /home/git0/git-source/git-1.6.3.4 
> DIRECTORY.  Review the compiler options and instructions in the comments 
> at the beginning of the file.  DO NOT RELY SOLELY ON THIS RSSS IN-HOUSE 
> DOCUMENT.
> 5.3  [neal]$ make prefix=/usr all  The compiler options defaults should be 
> ok.  Review the Makefile instructions to review the options.
> 5.4  Review output for errors.  Copy and paste the results into a file for 
> later reference.
> 5.4  SAMPLE of GOOD OUTPUT for 1.7.1 install:
> [git0@rsssDev git-1.7.1]$ make prefix=/usr all
> GIT_VERSION = 1.7.1
>    * new build flags or prefix
>    CC fast-import.o
>    CC abspath.o
>    CC advice.o
>    CC alias.o
>    CC alloc.o
>    CC archive.o
>    CC archive-tar.o
>    CC archive-zip.o
>    CC attr.o
>    CC base85.o
>    CC bisect.o
>    CC blob.o
>    CC branch.o
>    CC bundle.o
>    CC cache-tree.o
>    CC color.o
>    CC combine-diff.o
>    CC commit.o
>    CC config.o
>    CC connect.o
>    CC convert.o
>    CC copy.o
>    CC csum-file.o
>    CC ctype.o
>    CC date.o
>    CC decorate.o
>    CC diffcore-break.o
>    CC diffcore-delta.o
>    CC diffcore-order.o
>    CC diffcore-pickaxe.o
>    CC diffcore-rename.o
>    CC diff-delta.o
>    CC diff-lib.o
>    CC diff-no-index.o
>    CC diff.o
>    CC dir.o
>    CC editor.o
>    CC entry.o
>    CC environment.o
>    CC exec_cmd.o
>    CC fsck.o
>    CC graph.o
>    CC grep.o
>    CC hash.o
>    CC help.o
>    CC hex.o
>    CC ident.o
>    CC levenshtein.o
>    CC list-objects.o
>    CC ll-merge.o
>    CC lockfile.o
>    CC log-tree.o
>    CC mailmap.o
>    CC match-trees.o
>    CC merge-file.o
>    CC merge-recursive.o
>    CC name-hash.o
>    CC notes.o
>    CC object.o
>    CC pack-check.o
>    CC pack-refs.o
>    CC pack-revindex.o
>    CC pack-write.o
>    CC pager.o
>    CC parse-options.o
>    CC patch-delta.o
>    CC patch-ids.o
>    CC path.o
>    CC pkt-line.o
>    CC preload-index.o
>    CC pretty.o
>    CC progress.o
>    CC quote.o
>    CC reachable.o
>    CC read-cache.o
>    CC reflog-walk.o
>    CC refs.o
>    CC remote.o
>    CC replace_object.o
>    CC rerere.o
>    CC resolve-undo.o
>    CC revision.o
>    CC run-command.o
>    CC server-info.o
>    CC setup.o
>    CC sha1-lookup.o
>    CC sha1_file.o
>    CC sha1_name.o
>    CC shallow.o
>    CC sideband.o
>    CC sigchain.o
>    CC strbuf.o
>    CC string-list.o
>    CC submodule.o
>    CC symlinks.o
>    CC tag.o
>    CC trace.o
>    CC transport.o
>    CC transport-helper.o
>    CC tree-diff.o
>    CC tree.o
>    CC tree-walk.o
>    CC unpack-trees.o
>    CC usage.o
>    CC userdiff.o
>    CC utf8.o
>    CC walker.o
>    CC wrapper.o
>    CC write_or_die.o
>    CC ws.o
>    CC wt-status.o
>    CC xdiff-interface.o
>    CC thread-utils.o
>    CC compat/strlcpy.o
>    AR libgit.a
>    CC xdiff/xdiffi.o
>    CC xdiff/xprepare.o
>    CC xdiff/xutils.o
>    CC xdiff/xemit.o
>    CC xdiff/xmerge.o
>    CC xdiff/xpatience.o
>    AR xdiff/lib.a
>    LINK git-fast-import
>    CC imap-send.o
>    LINK git-imap-send
>    CC shell.o
>    LINK git-shell
>    CC show-index.o
>    LINK git-show-index
>    CC upload-pack.o
>    LINK git-upload-pack
>    CC http-backend.o
>    LINK git-http-backend
>    CC http.o
>    CC http-walker.o
>    CC http-fetch.o
>    LINK git-http-fetch
>    CC http-push.o
>    LINK git-http-push
>    CC daemon.o
>    LINK git-daemon
>    CC remote-curl.o
>    LINK git-remote-http
>    LN/CP git-remote-https
>    LN/CP git-remote-ftp
>    LN/CP git-remote-ftps
>    GEN git-am
>    GEN git-bisect
>    GEN git-difftool--helper
>    GEN git-filter-branch
>    GEN git-lost-found
>    GEN git-merge-octopus
>    GEN git-merge-one-file
>    GEN git-merge-resolve
>    GEN git-mergetool
>    GEN git-pull
>    GEN git-quiltimport
>    GEN git-rebase--interactive
>    GEN git-rebase
>    GEN git-repack
>    GEN git-request-pull
>    GEN git-stash
>    GEN git-submodule
>    GEN git-web--browse
>    SUBDIR perl
> /usr/bin/perl Makefile.PL PREFIX='/usr'
> Writing perl.mak for Git
>    GEN git-add--interactive
>    GEN git-difftool
>    GEN git-archimport
>    GEN git-cvsexportcommit
>    GEN git-cvsimport
>    GEN git-cvsserver
>    GEN git-relink
>    GEN git-send-email
>    GEN git-svn
>    SUBDIR gitweb
>    SUBDIR ../
> make[2]: `GIT-VERSION-FILE' is up to date.
>    GEN gitweb.cgi
>    GEN git-instaweb
>    GEN git-mergetool--lib
>    GEN git-parse-remote
>    GEN git-sh-setup
>    GEN common-cmds.h
>    CC git.o
>    CC builtin/add.o
>    CC builtin/annotate.o
>    CC builtin/apply.o
>    CC builtin/archive.o
>    CC builtin/bisect--helper.o
>    CC builtin/blame.o
>    CC builtin/branch.o
>    CC builtin/bundle.o
>    CC builtin/cat-file.o
>    CC builtin/check-attr.o
>    CC builtin/check-ref-format.o
>    CC builtin/checkout-index.o
>    CC builtin/checkout.o
>    CC builtin/clean.o
>    CC builtin/clone.o
>    CC builtin/commit-tree.o
>    CC builtin/commit.o
>    CC builtin/config.o
>    CC builtin/count-objects.o
>    CC builtin/describe.o
>    CC builtin/diff-files.o
>    CC builtin/diff-index.o
>    CC builtin/diff-tree.o
>    CC builtin/diff.o
>    CC builtin/fast-export.o
>    CC builtin/fetch-pack.o
>    CC builtin/fetch.o
>    CC builtin/fmt-merge-msg.o
>    CC builtin/for-each-ref.o
>    CC builtin/fsck.o
>    CC builtin/gc.o
>    CC builtin/grep.o
>    CC builtin/hash-object.o
>    CC builtin/help.o
>    CC builtin/index-pack.o
>    CC builtin/init-db.o
>    CC builtin/log.o
>    CC builtin/ls-files.o
>    CC builtin/ls-remote.o
>    CC builtin/ls-tree.o
>    CC builtin/mailinfo.o
>    CC builtin/mailsplit.o
>    CC builtin/merge.o
>    CC builtin/merge-base.o
>    CC builtin/merge-file.o
>    CC builtin/merge-index.o
>    CC builtin/merge-ours.o
>    CC builtin/merge-recursive.o
>    CC builtin/merge-tree.o
>    CC builtin/mktag.o
>    CC builtin/mktree.o
>    CC builtin/mv.o
>    CC builtin/name-rev.o
>    CC builtin/notes.o
>    CC builtin/pack-objects.o
>    CC builtin/pack-redundant.o
>    CC builtin/pack-refs.o
>    CC builtin/patch-id.o
>    CC builtin/prune-packed.o
>    CC builtin/prune.o
>    CC builtin/push.o
>    CC builtin/read-tree.o
>    CC builtin/receive-pack.o
>    CC builtin/reflog.o
>    CC builtin/remote.o
>    CC builtin/replace.o
>    CC builtin/rerere.o
>    CC builtin/reset.o
>    CC builtin/rev-list.o
>    CC builtin/rev-parse.o
>    CC builtin/revert.o
>    CC builtin/rm.o
>    CC builtin/send-pack.o
>    CC builtin/shortlog.o
>    CC builtin/show-branch.o
>    CC builtin/show-ref.o
>    CC builtin/stripspace.o
>    CC builtin/symbolic-ref.o
>    CC builtin/tag.o
>    CC builtin/tar-tree.o
>    CC builtin/unpack-file.o
>    CC builtin/unpack-objects.o
>    CC builtin/update-index.o
>    CC builtin/update-ref.o
>    CC builtin/update-server-info.o
>    CC builtin/upload-archive.o
>    CC builtin/var.o
>    CC builtin/verify-pack.o
>    CC builtin/verify-tag.o
>    CC builtin/write-tree.o
>    LINK git
>    BUILTIN git-add
>    BUILTIN git-annotate
>    BUILTIN git-apply
>    BUILTIN git-archive
>    BUILTIN git-bisect--helper
>    BUILTIN git-blame
>    BUILTIN git-branch
>    BUILTIN git-bundle
>    BUILTIN git-cat-file
>    BUILTIN git-check-attr
>    BUILTIN git-check-ref-format
>    BUILTIN git-checkout-index
>    BUILTIN git-checkout
>    BUILTIN git-clean
>    BUILTIN git-clone
>    BUILTIN git-commit-tree
>    BUILTIN git-commit
>    BUILTIN git-config
>    BUILTIN git-count-objects
>    BUILTIN git-describe
>    BUILTIN git-diff-files
>    BUILTIN git-diff-index
>    BUILTIN git-diff-tree
>    BUILTIN git-diff
>    BUILTIN git-fast-export
>    BUILTIN git-fetch-pack
>    BUILTIN git-fetch
>    BUILTIN git-fmt-merge-msg
>    BUILTIN git-for-each-ref
>    BUILTIN git-fsck
>    BUILTIN git-gc
>    BUILTIN git-grep
>    BUILTIN git-hash-object
>    BUILTIN git-help
>    BUILTIN git-index-pack
>    BUILTIN git-init-db
>    BUILTIN git-log
>    BUILTIN git-ls-files
>    BUILTIN git-ls-remote
>    BUILTIN git-ls-tree
>    BUILTIN git-mailinfo
>    BUILTIN git-mailsplit
>    BUILTIN git-merge
>    BUILTIN git-merge-base
>    BUILTIN git-merge-file
>    BUILTIN git-merge-index
>    BUILTIN git-merge-ours
>    BUILTIN git-merge-recursive
>    BUILTIN git-merge-tree
>    BUILTIN git-mktag
>    BUILTIN git-mktree
>    BUILTIN git-mv
>    BUILTIN git-name-rev
>    BUILTIN git-notes
>    BUILTIN git-pack-objects
>    BUILTIN git-pack-redundant
>    BUILTIN git-pack-refs
>    BUILTIN git-patch-id
>    BUILTIN git-prune-packed
>    BUILTIN git-prune
>    BUILTIN git-push
>    BUILTIN git-read-tree
>    BUILTIN git-receive-pack
>    BUILTIN git-reflog
>    BUILTIN git-remote
>    BUILTIN git-replace
>    BUILTIN git-rerere
>    BUILTIN git-reset
>    BUILTIN git-rev-list
>    BUILTIN git-rev-parse
>    BUILTIN git-revert
>    BUILTIN git-rm
>    BUILTIN git-send-pack
>    BUILTIN git-shortlog
>    BUILTIN git-show-branch
>    BUILTIN git-show-ref
>    BUILTIN git-stripspace
>    BUILTIN git-symbolic-ref
>    BUILTIN git-tag
>    BUILTIN git-tar-tree
>    BUILTIN git-unpack-file
>    BUILTIN git-unpack-objects
>    BUILTIN git-update-index
>    BUILTIN git-update-ref
>    BUILTIN git-update-server-info
>    BUILTIN git-upload-archive
>    BUILTIN git-var
>    BUILTIN git-verify-pack
>    BUILTIN git-verify-tag
>    BUILTIN git-write-tree
>    BUILTIN git-cherry
>    BUILTIN git-cherry-pick
>    BUILTIN git-format-patch
>    BUILTIN git-fsck-objects
>    BUILTIN git-get-tar-commit-id
>    BUILTIN git-init
>    BUILTIN git-merge-subtree
>    BUILTIN git-peek-remote
>    BUILTIN git-repo-config
>    BUILTIN git-show
>    BUILTIN git-stage
>    BUILTIN git-status
>    BUILTIN git-whatchanged
>    SUBDIR git-gui
> GITGUI_VERSION = 0.12.0.64.g89d6
>    * new locations or Tcl/Tk interpreter
>    GEN git-gui
>    INDEX lib/
>    MSGFMT    po/de.msg 520 translated.
>    MSGFMT    po/el.msg 381 translated, 4 fuzzy, 6 untranslated.
>    MSGFMT    po/fr.msg 520 translated.
>    MSGFMT    po/hu.msg 514 translated.
>    MSGFMT    po/it.msg 519 translated, 1 untranslated.
>    MSGFMT    po/ja.msg 520 translated.
>    MSGFMT    po/nb.msg 474 translated, 39 untranslated.
>    MSGFMT    po/ru.msg 513 translated, 2 untranslated.
>    MSGFMT    po/sv.msg 520 translated.
>    MSGFMT po/zh_cn.msg 366 translated, 7 fuzzy, 17 untranslated.
>    SUBDIR gitk-git
>    GEN gitk-wish
> Generating catalog po/de.msg
> msgfmt --statistics --tcl po/de.po -l de -d po/
> 289 translated messages.
> Generating catalog po/es.msg
> msgfmt --statistics --tcl po/es.po -l es -d po/
> 200 translated messages, 7 untranslated messages.
> Generating catalog po/fr.msg
> msgfmt --statistics --tcl po/fr.po -l fr -d po/
> 276 translated messages, 4 fuzzy translations.
> Generating catalog po/hu.msg
> msgfmt --statistics --tcl po/hu.po -l hu -d po/
> 288 translated messages.
> Generating catalog po/it.msg
> msgfmt --statistics --tcl po/it.po -l it -d po/
> 283 translated messages, 6 untranslated messages.
> Generating catalog po/ja.msg
> msgfmt --statistics --tcl po/ja.po -l ja -d po/
> 284 translated messages.
> Generating catalog po/ru.msg
> msgfmt --statistics --tcl po/ru.po -l ru -d po/
> 245 translated messages.
> Generating catalog po/sv.msg
> msgfmt --statistics --tcl po/sv.po -l sv -d po/
> 289 translated messages.
>    SUBDIR perl
> cp Git.pm blib/lib/Git.pm
> Manifying blib/man3/Git.3pm
>    SUBDIR git_remote_helpers
>    SUBDIR templates
>    CC test-chmtime.o
>    LINK test-chmtime
>    CC test-ctype.o
>    LINK test-ctype
>    CC test-date.o
>    LINK test-date
>    CC test-delta.o
>    LINK test-delta
>    CC test-dump-cache-tree.o
>    LINK test-dump-cache-tree
>    CC test-genrandom.o
>    LINK test-genrandom
>    CC test-match-trees.o
>    LINK test-match-trees
>    CC test-parse-options.o
>    LINK test-parse-options
>    CC test-path-utils.o
>    LINK test-path-utils
>    CC test-run-command.o
>    LINK test-run-command
>    CC test-sha1.o
>    LINK test-sha1
>    CC test-sigchain.o
>    LINK test-sigchain
>    CC test-index-version.o
>    LINK test-index-version
>    GEN bin-wrappers/git
>    GEN bin-wrappers/git-upload-pack
>    GEN bin-wrappers/git-receive-pack
>    GEN bin-wrappers/git-upload-archive
>    GEN bin-wrappers/git-shell
>    GEN bin-wrappers/git-cvsserver
>    GEN bin-wrappers/test-chmtime
>    GEN bin-wrappers/test-ctype
>    GEN bin-wrappers/test-date
>    GEN bin-wrappers/test-delta
>    GEN bin-wrappers/test-dump-cache-tree
>    GEN bin-wrappers/test-genrandom
>    GEN bin-wrappers/test-match-trees
>    GEN bin-wrappers/test-parse-options
>    GEN bin-wrappers/test-path-utils
>    GEN bin-wrappers/test-run-command
>    GEN bin-wrappers/test-sha1
>    GEN bin-wrappers/test-sigchain
>    GEN bin-wrappers/test-index-version
> 6.  Install Git.
> 6.1  Login as root.
> 6.2  [root]# cd /home/git0/git-source/git-1.6.3.4
> 6.3  [root]# make prefix=/usr install
> 6.3 SAMPLE of GOOD OUTPUT for 1.7.1 install:
> [root]# make prefix=/usr install
>    SUBDIR git-gui
>    SUBDIR gitk-git
> make[1]: Nothing to be done for `all'.
>    SUBDIR perl
>    SUBDIR git_remote_helpers
>    SUBDIR templates
> install -d -m 755 '/usr/bin'
> install -d -m 755 '/usr/libexec/git-core'
> install   git-fast-import git-imap-send git-shell git-show-index 
> git-upload-pack
> git-http-backend git-http-fetch git-http-push git-daemon git-remote-http 
> git-re
> mote-https git-remote-ftp git-remote-ftps git-am git-bisect 
> git-difftool--helper
> git-filter-branch git-lost-found git-merge-octopus git-merge-one-file 
> git-merge
> -resolve git-mergetool git-pull git-quiltimport git-rebase--interactive 
> git-reba
> se git-repack git-request-pull git-stash git-submodule git-web--browse 
> git-add--
> interactive git-difftool git-archimport git-cvsexportcommit git-cvsimport 
> git-cv
> sserver git-relink git-send-email git-svn  git-instaweb 
> '/usr/libexec/git-core'
> install -m 644  git-mergetool--lib git-parse-remote git-sh-setup 
> '/usr/libexec/g
> it-core'
> install git git-upload-pack git-receive-pack git-upload-archive git-shell 
> git-cv
> sserver '/usr/bin'
> make -C templates DESTDIR='' install
> make[1]: Entering directory `/home/git0/git-source/git-1.7.1/templates'
> install -d -m 755 '/usr/share/git-core/templates'
> (cd blt && tar cf - .) | \
>        (cd '/usr/share/git-core/templates' && umask 022 && tar xof -)
> make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/templates'
> make -C perl prefix='/usr' DESTDIR='' install
> make[1]: Entering directory `/home/git0/git-source/git-1.7.1/perl'
> make[2]: Entering directory `/home/git0/git-source/git-1.7.1/perl'
> Installing /usr/lib/perl5/site_perl/5.8.8/Git.pm
> Installing /usr/share/man/man3/Git.3pm
> Writing 
> /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Git/.pac
> klist
> Appending installation info to 
> /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/
> perllocal.pod
> make[2]: Leaving directory `/home/git0/git-source/git-1.7.1/perl'
> make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/perl'
> make -C git_remote_helpers prefix='/usr' DESTDIR='' install
> make[1]: Entering directory 
> `/home/git0/git-source/git-1.7.1/git_remote_helpers'
>
> /usr/bin/python setup.py install --prefix /usr
> running install
> running build
> running build_py
> running install_lib
> copying build/lib/git_remote_helpers/git/git.py -> 
> /usr/lib/python2.4/site-packa
> ges/git_remote_helpers/git
> copying build/lib/git_remote_helpers/git/__init__.py -> 
> /usr/lib/python2.4/site-
> packages/git_remote_helpers/git
> copying build/lib/git_remote_helpers/util.py -> 
> /usr/lib/python2.4/site-packages
> /git_remote_helpers
> copying build/lib/git_remote_helpers/__init__.py -> 
> /usr/lib/python2.4/site-pack
> ages/git_remote_helpers
> byte-compiling 
> /usr/lib/python2.4/site-packages/git_remote_helpers/git/git.py to
> git.pyc
> byte-compiling 
> /usr/lib/python2.4/site-packages/git_remote_helpers/git/__init__.
> py to __init__.pyc
> byte-compiling /usr/lib/python2.4/site-packages/git_remote_helpers/util.py 
> to ut
> il.pyc
> byte-compiling 
> /usr/lib/python2.4/site-packages/git_remote_helpers/__init__.py t
> o __init__.pyc
> make[1]: Leaving directory 
> `/home/git0/git-source/git-1.7.1/git_remote_helpers'
> make -C gitk-git install
> make[1]: Entering directory `/home/git0/git-source/git-1.7.1/gitk-git'
> install -m 755 gitk-wish '/usr/bin'/gitk
> install -d -m 755 '/usr/share/gitk/lib/msgs'
> install -m 644 po/de.msg '/usr/share/gitk/lib/msgs' &&  install -m 644 
> po/es.msg
> '/usr/share/gitk/lib/msgs' &&  install -m 644 po/fr.msg 
> '/usr/share/gitk/lib/ms
> gs' &&  install -m 644 po/hu.msg '/usr/share/gitk/lib/msgs' &&  install -m 
> 644 p
> o/it.msg '/usr/share/gitk/lib/msgs' &&  install -m 644 po/ja.msg 
> '/usr/share/git
> k/lib/msgs' &&  install -m 644 po/ru.msg '/usr/share/gitk/lib/msgs' && 
> install
> -m 644 po/sv.msg '/usr/share/gitk/lib/msgs' && true
> make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/gitk-git'
> make -C git-gui gitexecdir='/usr/libexec/git-core' install
> make[1]: Entering directory `/home/git0/git-source/git-1.7.1/git-gui'
>  DEST /usr/libexec/git-core
>    INSTALL 755 git-gui
>    INSTALL 755 git-gui--askpass
>    LINK        git-citool -> git-gui
>  DEST /usr/share/git-gui/lib
>    INSTALL 644 tclIndex
>    INSTALL 644 about.tcl
>    INSTALL 644 blame.tcl
>    INSTALL 644 branch.tcl
>    INSTALL 644 branch_checkout.tcl
>    INSTALL 644 branch_create.tcl
>    INSTALL 644 branch_delete.tcl
>    INSTALL 644 branch_rename.tcl
>    INSTALL 644 browser.tcl
>    INSTALL 644 checkout_op.tcl
>    INSTALL 644 choose_font.tcl
>    INSTALL 644 choose_repository.tcl
>    INSTALL 644 choose_rev.tcl
>    INSTALL 644 class.tcl
>    INSTALL 644 commit.tcl
>    INSTALL 644 console.tcl
>    INSTALL 644 database.tcl
>    INSTALL 644 date.tcl
>    INSTALL 644 diff.tcl
>    INSTALL 644 encoding.tcl
>    INSTALL 644 error.tcl
>    INSTALL 644 index.tcl
>    INSTALL 644 logo.tcl
>    INSTALL 644 merge.tcl
>    INSTALL 644 mergetool.tcl
>    INSTALL 644 option.tcl
>    INSTALL 644 remote.tcl
>    INSTALL 644 remote_add.tcl
>    INSTALL 644 remote_branch_delete.tcl
>    INSTALL 644 search.tcl
>    INSTALL 644 shortcut.tcl
>    INSTALL 644 spellcheck.tcl
>    INSTALL 644 sshkey.tcl
>    INSTALL 644 status_bar.tcl
>    INSTALL 644 themed.tcl
>    INSTALL 644 tools.tcl
>    INSTALL 644 tools_dlg.tcl
>    INSTALL 644 transport.tcl
>    INSTALL 644 win32.tcl
>    INSTALL 644 git-gui.ico
>    INSTALL 644 win32_shortcut.js
>  DEST /usr/share/git-gui/lib/msgs
>    INSTALL 644 de.msg
>    INSTALL 644 el.msg
>    INSTALL 644 fr.msg
>    INSTALL 644 hu.msg
>    INSTALL 644 it.msg
>    INSTALL 644 ja.msg
>    INSTALL 644 nb.msg
>    INSTALL 644 ru.msg
>    INSTALL 644 sv.msg
>    INSTALL 644 zh_cn.msg
> make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/git-gui'
> bindir=$(cd '/usr/bin' && pwd) && \
>        execdir=$(cd '/usr/libexec/git-core' && pwd) && \
>        { test "$bindir/" = "$execdir/" || \
>                { rm -f "$execdir/git" && \
>                test -z "" && \
>                ln "$bindir/git" "$execdir/git" 2>/dev/null || \
>                cp "$bindir/git" "$execdir/git"; } ; } && \
>        { for p in  git-add git-annotate git-apply git-archive 
> git-bisect--helpe
> r git-blame git-branch git-bundle git-cat-file git-check-attr 
> git-check-ref-form
> at git-checkout-index git-checkout git-clean git-clone git-commit-tree 
> git-commi
> t git-config git-count-objects git-describe git-diff-files git-diff-index 
> git-di
> ff-tree git-diff git-fast-export git-fetch-pack git-fetch 
> git-fmt-merge-msg git-
> for-each-ref git-fsck git-gc git-grep git-hash-object git-help 
> git-index-pack gi
> t-init-db git-log git-ls-files git-ls-remote git-ls-tree git-mailinfo 
> git-mailsp
> lit git-merge git-merge-base git-merge-file git-merge-index git-merge-ours 
> git-m
> erge-recursive git-merge-tree git-mktag git-mktree git-mv git-name-rev 
> git-notes
> git-pack-objects git-pack-redundant git-pack-refs git-patch-id 
> git-prune-packed
> git-prune git-push git-read-tree git-receive-pack git-reflog git-remote 
> git-rep
> lace git-rerere git-reset git-rev-list git-rev-parse git-revert git-rm 
> git-send-
> pack git-shortlog git-show-branch git-show-ref git-stripspace 
> git-symbolic-ref g
> it-tag git-tar-tree git-unpack-file git-unpack-objects git-update-index 
> git-upda
> te-ref git-update-server-info git-upload-archive git-var git-verify-pack 
> git-ver
> ify-tag git-write-tree git-cherry git-cherry-pick git-format-patch 
> git-fsck-obje
> cts git-get-tar-commit-id git-init git-merge-subtree git-peek-remote 
> git-repo-co
> nfig git-show git-stage git-status git-whatchanged; do \
>                rm -f "$execdir/$p" && \
>                ln "$execdir/git" "$execdir/$p" 2>/dev/null || \
>                ln -s "git" "$execdir/$p" 2>/dev/null || \
>                cp "$execdir/git" "$execdir/$p" || exit; \
>          done; } && \
>        { for p in git-remote-https git-remote-ftp git-remote-ftps; do \
>                rm -f "$execdir/$p" && \
>                ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || 
> \
>                ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
>                cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
>          done; } && \
>        ./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
> [root]#
> 7.  Validate Git.
> 7.1  See what version of git is installed.
> [neal]$ git --version
> 7.2  See where git is installed.
> [neal]$ git --exec-path
> 7.3  VNC to gui desktop.
> Open Terminal.
> [neal]$ gitk  validate that gitk executes and displays.
> [neal]$ git gui  validate that git gui executes and displays.
> Note:  Only after you have a local repository working tree can you can 
> validate xdg-utils as follows:
> <Repository> -> <Browse Master's Files>  validate's xdg-utils.
>
>
> GIT INSTALL.  PART 2.  INSTALL GIT RELATED TOOLS.
> 1.  Install KDiff3.  Merge tool.
> 1.1  [root]# yum list kdiff3  (See if its already installed.)
> 1.2  [root]# yum install kdiff3  (Install it if it is not already 
> installed.)
> 1.3  [root]# yum list kdiff3  (Verify that it is installed.)
> 1.3  SAMPLE OUTPUT:
> kdiff3.x86_64                      0.9.92-14.el5 installed
>
>
> Like I said, this is what has worked for me.  Hope this helps!
>
> (If anyone has any *PROVEN* improvements and/or additions to my procedures 
> then by all means let me know...)
>
>
> v/r,
> Neal

Patrick,

If your 'yum list' commands shows that you don't have a package installed or 
there is a newer version of the package then you will need to install/update 
that package.  Here are my notes:

A1.  LINUX PACKAGE MANAGEMENT PRIMER.
Software Installation and Updates.

root Access
[neal]$ su root
use the "su root" (switch user) command to access root authority whenever 
possible.  Most root commands will run from here.  If the command returns
bash: adduser: command not found
then "su root" does not have access and you must actually login as root to 
execute that command.
Type "exit" to switch back to your previous signon from "su".
"su" is the same as "su root".

Software Update Commands
yum
yum installs and updates software packages (RPMs).

RPM:  a software package.

rpm name formats:
*.i386  32-bit software package.  Use these rpms if your OS is 32-bit. 
32-bit OS cannot run 64-bit rpms.
*.x86_64  64-bit software package.  Use these rpms if your OS is 64-bit. 
64-bit OS can run 32-bit and 64-bit rpms.  64-bit is preferred.

$ yum list packagename
lists RPMs that are already installed or available to be installed.

Installed Packages  RPMs that are already installed.

Available Packages  RPMs that are not currently installed, but that are 
available on the software repositories for installation or update.

$ yum update packagename
updates already installed software package (RPM) to newer version.
requires root login.

$ yum install packagename
installs package for the first time.
requires root login.

(You probably already know this stuff, but I'm including it so my 
instructions are more comprehensive)

v/r,
Neal 

^ permalink raw reply

* Re: Intermittent failures in t9119
From: Eric Wong @ 2010-12-06 19:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: David D. Kilzer, git
In-Reply-To: <7vy684t0mt.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
>  (2) Nobody uses the value from "Text Last Updated" field in practice, so
>      that bug has been unnoticed so far;
> 
>  (3) And it is not worth fixing it ;-)
> 
> For now, I would suggest fixing the failing test to ignore the "Text Last
> Updated" field while comparing, and if somebody is inclined to, we would
> update the code to match what "svn info" does.

Agreed on both points.  I consider "git svn log" and "git svn info" to
be reasonable approximations of svn behavior, not exact replicas.
Exactly matching would be extremely difficult given variations between
different svn versions, and also svn requiring network access while
git svn does not.

-- 
Eric Wong

^ permalink raw reply

* Re: path/to/some/file: needs update
From: Neal Kreitzinger @ 2010-12-06 19:06 UTC (permalink / raw)
  To: git
In-Reply-To: <AANLkTinFHFzjLNb5PpoH8WG_3gHpo4LaZaUOYX-=PFYN@mail.gmail.com>

>"Patrick Doyle" <wpdster@gmail.com> wrote in message 
>news:AANLkTinFHFzjLNb5PpoH8WG_3gHpo4LaZaUOYX->=PFYN@mail.gmail.com...
>On Fri, Dec 3, 2010 at 1:58 PM, Matthieu Moy
><Matthieu.Moy@grenoble-inp.fr> wrote:
>> Patrick Doyle <wpdster@gmail.com> writes:
>>
>>> path/to/some/file: needs update.
>>>
>>> Then things got worse... one of the messages said:
>>>
>>> error: Entry 'path/to/some/binaryfile' not uptodate. Cannot merge
>>
>> Which commands triggered these messages? Which version of Git?
>>
>> AFAICT, these messages never appear anymore in normal (porcelain) use
>> in recent Gits.
>Ahhh... that's something.
>
>I just checked.  The box they  were using is an RHEL 5 box that has
>1.5.5.6 installed on it.  Perhaps it's time to upgrade their git.
>I'll go see what repo I need to add to RHEL to get a more recent git.
>
>Thanks.
>
>--wpd

Hi, Patrick,

There isn't an RHEL or EPEL rpm for a current version of git.  What you'll 
need to do is build git yourself using the tarball download from git.  The 
make file provided by git has worked great for me.  Here are my instructions 
on how I did it.  They are written for a linux newbie (me) and I've used 
them for several git installs/upgrades and my linux-illiterate coworker has 
successfully used them too (with me looking over his shoulder).  Because 
I've used it for several installs, some different git version numbers are in 
the detailed notes.  I've left them there for precision.  However, in my 
experience the steps were the same for these differnt git versions, so you 
can pretend they are for whatever git version you end up chosing to install. 
We have dozens of git repos in production being used for productional 
development, and several servers with git installed, so hopefully these 
instructions should work for you too:

"How to install git on Red Hat, RHEL"
NOTE:  This only includes what is needed to get command line git, gitk, and 
git gui working.  It does NOT include the extra stuff needed to get gitweb, 
or git documentation (manpages, html, etc) working.

GIT INSTALL, PART 1.  INSTALL GIT.
Compile Git manually because Red Hat's Git version is obsolete.

1.  Choose a git version.
1.1  Review the git release notes: 
http://www.kernel.org/pub/software/scm/git/docs/  The last minor revision of 
major release is the usually the safest because many bugfixes have been 
made.  A version that has a corresponding git manual release number is also 
preferable.  Usually the last revision of a major release also has a 
corresponding git manual release - this is ideal.
2.  Download git sourcecode.
2.1  Use the git0 login for the source download:   (note:  'git0' is 
whatever login you have allocated as the 'git admin' signon.)
[git0]$ cd /home/git0
2.2  Create a specific folder for the git source:
[git0]$ mkdir git-source
[git0]$ cd /home/git0/git-source
2.3  Review the git source tar files located on: 
http://www.kernel.org/pub/software/scm/git/  and locate the tar for your 
chosen version.
2.4  Copy and paste the url into the wget command, and then copy and paste 
(append) the tar filename to the end of the wget command:
[git0]$ wget http://kernel.org/pub/software/scm/git/git-1.6.3.4.tar.gz 
where 1.6.3.4 is your chosen git version.
2.5  Untar the git sourcecode:
[git0]$ tar xzf git-1.6.3.4.tar.gz  (where 1.6.3.4 is whatever git version 
you chose to install.)
[git0]$ cd git-1.6.3.4  (the tar command created this directory for you.)
[git0]$ ls -la  (verify the contents.)
3.  Research Git Dependencies.  Validate prerequisite packages and install 
if necessary.
3.1  Read INSTALL file of git source release to obtain the current list of 
prerequisite packages.  The development version of these packages is 
required or preferred in order to perform a compile of git.  Development 
packages have the same name but are suffixed with "-devel", e.g.  zlib-devel 
instead of zlib.  The regular non-devel version of the package IS STILL 
REQUIRED, e.g. zlib-devel AND zlib.
3.1.1  [git0]$ cat /home/git0/git-source/git-1.6.3.4/INSTALL
4.  Resolve Git Dependencies.
Validate prerequisite packages and install if necessary.  The following is 
the dependency list from the git-1.6.3.4 INSTALL file:
REMINDER:
READ YOUR INSTALL FILE FROM GIT.  DO NOT RELY SOLELY ON THIS IN-HOUSE 
DOCUMENT.
4.1  "zlib", the compression library. Git won't build without it.
4.1.1  [neal]$ yum list zlib
4.1.2  [neal]$ yum list zlib-devel
4.2  "openssl".  Unless you specify otherwise, you'll get the SHA1 library 
from here.  If you don't have openssl, you can use one of the SHA1 libraries 
that come with git (git includes the one from Mozilla, and has its own 
PowerPC and ARM optimized ones too - see the Makefile).
4.2.1  [neal]$ yum list openssl
4.2.2  [neal]$ yum list openssl-devel
4.3  libcurl library; git-http-fetch and git-fetch use them.  You might also 
want the "curl" executable for debugging purposes. If you do not use http 
transfer, you are probably OK if you do not have them.
NOTE: I installed security updates, 'yum update --security' to remediate 
out-of-date curl packages.
NOTE:  to get yum security plugin:
$ yum install yum-security.  (allows security updates only.)
4.3.1  [neal]$ yum list curl  (Red Hat calls it curl instead of libcurl.)
4.3.2  [neal]$ yum list curl-devel  (Red Hat calls it curl-devel instead of 
libcurl-devel.)
4.4  expat library; git-http-push uses it for remote lock management over 
DAV.  Similar to "curl" above, this is optional.
4.4.1  [neal]$ yum list expat
4.4.2  [neal]$ yum list expat-devel
4.5  "wish", the Tcl/Tk windowing shell is used in gitk to show the history 
graphically, and in git-gui.
4.5.1  [neal]$ yum list tcl
4.5.2  [neal]$ yum list tcl-devel
4.5.3  [neal]$ yum list tk
4.5.4  [neal]$ yum list tk-devel
4.5.5  [neal]$ yum list xdg-utils  (development version "-devel" is not 
needed for xdg-utils.)
4.6  "ssh" is used to push and pull over the net.
4.6.1  There is no package to validate.  In Red Hat this is part of the OS.
4.7  "perl" and POSIX-compliant shells are needed to use most of the 
bare-bones Porcelainish scripts.
4.7.1  [neal]$ yum list perl  (Perl is a programming language.  There is no 
"-devel" version required.)
5.  Compile Git.
5.1  Perform the Git installation process from the 
/home/git0/git-source/git-1.6.3.4 directory:
[neal]$ cd /home/git0/git-source/git-1.6.3.4
5.2  READ THE "Makefile" LOCATED IN THE /home/git0/git-source/git-1.6.3.4 
DIRECTORY.  Review the compiler options and instructions in the comments at 
the beginning of the file.  DO NOT RELY SOLELY ON THIS RSSS IN-HOUSE 
DOCUMENT.
5.3  [neal]$ make prefix=/usr all  The compiler options defaults should be 
ok.  Review the Makefile instructions to review the options.
5.4  Review output for errors.  Copy and paste the results into a file for 
later reference.
5.4  SAMPLE of GOOD OUTPUT for 1.7.1 install:
[git0@rsssDev git-1.7.1]$ make prefix=/usr all
GIT_VERSION = 1.7.1
    * new build flags or prefix
    CC fast-import.o
    CC abspath.o
    CC advice.o
    CC alias.o
    CC alloc.o
    CC archive.o
    CC archive-tar.o
    CC archive-zip.o
    CC attr.o
    CC base85.o
    CC bisect.o
    CC blob.o
    CC branch.o
    CC bundle.o
    CC cache-tree.o
    CC color.o
    CC combine-diff.o
    CC commit.o
    CC config.o
    CC connect.o
    CC convert.o
    CC copy.o
    CC csum-file.o
    CC ctype.o
    CC date.o
    CC decorate.o
    CC diffcore-break.o
    CC diffcore-delta.o
    CC diffcore-order.o
    CC diffcore-pickaxe.o
    CC diffcore-rename.o
    CC diff-delta.o
    CC diff-lib.o
    CC diff-no-index.o
    CC diff.o
    CC dir.o
    CC editor.o
    CC entry.o
    CC environment.o
    CC exec_cmd.o
    CC fsck.o
    CC graph.o
    CC grep.o
    CC hash.o
    CC help.o
    CC hex.o
    CC ident.o
    CC levenshtein.o
    CC list-objects.o
    CC ll-merge.o
    CC lockfile.o
    CC log-tree.o
    CC mailmap.o
    CC match-trees.o
    CC merge-file.o
    CC merge-recursive.o
    CC name-hash.o
    CC notes.o
    CC object.o
    CC pack-check.o
    CC pack-refs.o
    CC pack-revindex.o
    CC pack-write.o
    CC pager.o
    CC parse-options.o
    CC patch-delta.o
    CC patch-ids.o
    CC path.o
    CC pkt-line.o
    CC preload-index.o
    CC pretty.o
    CC progress.o
    CC quote.o
    CC reachable.o
    CC read-cache.o
    CC reflog-walk.o
    CC refs.o
    CC remote.o
    CC replace_object.o
    CC rerere.o
    CC resolve-undo.o
    CC revision.o
    CC run-command.o
    CC server-info.o
    CC setup.o
    CC sha1-lookup.o
    CC sha1_file.o
    CC sha1_name.o
    CC shallow.o
    CC sideband.o
    CC sigchain.o
    CC strbuf.o
    CC string-list.o
    CC submodule.o
    CC symlinks.o
    CC tag.o
    CC trace.o
    CC transport.o
    CC transport-helper.o
    CC tree-diff.o
    CC tree.o
    CC tree-walk.o
    CC unpack-trees.o
    CC usage.o
    CC userdiff.o
    CC utf8.o
    CC walker.o
    CC wrapper.o
    CC write_or_die.o
    CC ws.o
    CC wt-status.o
    CC xdiff-interface.o
    CC thread-utils.o
    CC compat/strlcpy.o
    AR libgit.a
    CC xdiff/xdiffi.o
    CC xdiff/xprepare.o
    CC xdiff/xutils.o
    CC xdiff/xemit.o
    CC xdiff/xmerge.o
    CC xdiff/xpatience.o
    AR xdiff/lib.a
    LINK git-fast-import
    CC imap-send.o
    LINK git-imap-send
    CC shell.o
    LINK git-shell
    CC show-index.o
    LINK git-show-index
    CC upload-pack.o
    LINK git-upload-pack
    CC http-backend.o
    LINK git-http-backend
    CC http.o
    CC http-walker.o
    CC http-fetch.o
    LINK git-http-fetch
    CC http-push.o
    LINK git-http-push
    CC daemon.o
    LINK git-daemon
    CC remote-curl.o
    LINK git-remote-http
    LN/CP git-remote-https
    LN/CP git-remote-ftp
    LN/CP git-remote-ftps
    GEN git-am
    GEN git-bisect
    GEN git-difftool--helper
    GEN git-filter-branch
    GEN git-lost-found
    GEN git-merge-octopus
    GEN git-merge-one-file
    GEN git-merge-resolve
    GEN git-mergetool
    GEN git-pull
    GEN git-quiltimport
    GEN git-rebase--interactive
    GEN git-rebase
    GEN git-repack
    GEN git-request-pull
    GEN git-stash
    GEN git-submodule
    GEN git-web--browse
    SUBDIR perl
/usr/bin/perl Makefile.PL PREFIX='/usr'
Writing perl.mak for Git
    GEN git-add--interactive
    GEN git-difftool
    GEN git-archimport
    GEN git-cvsexportcommit
    GEN git-cvsimport
    GEN git-cvsserver
    GEN git-relink
    GEN git-send-email
    GEN git-svn
    SUBDIR gitweb
    SUBDIR ../
make[2]: `GIT-VERSION-FILE' is up to date.
    GEN gitweb.cgi
    GEN git-instaweb
    GEN git-mergetool--lib
    GEN git-parse-remote
    GEN git-sh-setup
    GEN common-cmds.h
    CC git.o
    CC builtin/add.o
    CC builtin/annotate.o
    CC builtin/apply.o
    CC builtin/archive.o
    CC builtin/bisect--helper.o
    CC builtin/blame.o
    CC builtin/branch.o
    CC builtin/bundle.o
    CC builtin/cat-file.o
    CC builtin/check-attr.o
    CC builtin/check-ref-format.o
    CC builtin/checkout-index.o
    CC builtin/checkout.o
    CC builtin/clean.o
    CC builtin/clone.o
    CC builtin/commit-tree.o
    CC builtin/commit.o
    CC builtin/config.o
    CC builtin/count-objects.o
    CC builtin/describe.o
    CC builtin/diff-files.o
    CC builtin/diff-index.o
    CC builtin/diff-tree.o
    CC builtin/diff.o
    CC builtin/fast-export.o
    CC builtin/fetch-pack.o
    CC builtin/fetch.o
    CC builtin/fmt-merge-msg.o
    CC builtin/for-each-ref.o
    CC builtin/fsck.o
    CC builtin/gc.o
    CC builtin/grep.o
    CC builtin/hash-object.o
    CC builtin/help.o
    CC builtin/index-pack.o
    CC builtin/init-db.o
    CC builtin/log.o
    CC builtin/ls-files.o
    CC builtin/ls-remote.o
    CC builtin/ls-tree.o
    CC builtin/mailinfo.o
    CC builtin/mailsplit.o
    CC builtin/merge.o
    CC builtin/merge-base.o
    CC builtin/merge-file.o
    CC builtin/merge-index.o
    CC builtin/merge-ours.o
    CC builtin/merge-recursive.o
    CC builtin/merge-tree.o
    CC builtin/mktag.o
    CC builtin/mktree.o
    CC builtin/mv.o
    CC builtin/name-rev.o
    CC builtin/notes.o
    CC builtin/pack-objects.o
    CC builtin/pack-redundant.o
    CC builtin/pack-refs.o
    CC builtin/patch-id.o
    CC builtin/prune-packed.o
    CC builtin/prune.o
    CC builtin/push.o
    CC builtin/read-tree.o
    CC builtin/receive-pack.o
    CC builtin/reflog.o
    CC builtin/remote.o
    CC builtin/replace.o
    CC builtin/rerere.o
    CC builtin/reset.o
    CC builtin/rev-list.o
    CC builtin/rev-parse.o
    CC builtin/revert.o
    CC builtin/rm.o
    CC builtin/send-pack.o
    CC builtin/shortlog.o
    CC builtin/show-branch.o
    CC builtin/show-ref.o
    CC builtin/stripspace.o
    CC builtin/symbolic-ref.o
    CC builtin/tag.o
    CC builtin/tar-tree.o
    CC builtin/unpack-file.o
    CC builtin/unpack-objects.o
    CC builtin/update-index.o
    CC builtin/update-ref.o
    CC builtin/update-server-info.o
    CC builtin/upload-archive.o
    CC builtin/var.o
    CC builtin/verify-pack.o
    CC builtin/verify-tag.o
    CC builtin/write-tree.o
    LINK git
    BUILTIN git-add
    BUILTIN git-annotate
    BUILTIN git-apply
    BUILTIN git-archive
    BUILTIN git-bisect--helper
    BUILTIN git-blame
    BUILTIN git-branch
    BUILTIN git-bundle
    BUILTIN git-cat-file
    BUILTIN git-check-attr
    BUILTIN git-check-ref-format
    BUILTIN git-checkout-index
    BUILTIN git-checkout
    BUILTIN git-clean
    BUILTIN git-clone
    BUILTIN git-commit-tree
    BUILTIN git-commit
    BUILTIN git-config
    BUILTIN git-count-objects
    BUILTIN git-describe
    BUILTIN git-diff-files
    BUILTIN git-diff-index
    BUILTIN git-diff-tree
    BUILTIN git-diff
    BUILTIN git-fast-export
    BUILTIN git-fetch-pack
    BUILTIN git-fetch
    BUILTIN git-fmt-merge-msg
    BUILTIN git-for-each-ref
    BUILTIN git-fsck
    BUILTIN git-gc
    BUILTIN git-grep
    BUILTIN git-hash-object
    BUILTIN git-help
    BUILTIN git-index-pack
    BUILTIN git-init-db
    BUILTIN git-log
    BUILTIN git-ls-files
    BUILTIN git-ls-remote
    BUILTIN git-ls-tree
    BUILTIN git-mailinfo
    BUILTIN git-mailsplit
    BUILTIN git-merge
    BUILTIN git-merge-base
    BUILTIN git-merge-file
    BUILTIN git-merge-index
    BUILTIN git-merge-ours
    BUILTIN git-merge-recursive
    BUILTIN git-merge-tree
    BUILTIN git-mktag
    BUILTIN git-mktree
    BUILTIN git-mv
    BUILTIN git-name-rev
    BUILTIN git-notes
    BUILTIN git-pack-objects
    BUILTIN git-pack-redundant
    BUILTIN git-pack-refs
    BUILTIN git-patch-id
    BUILTIN git-prune-packed
    BUILTIN git-prune
    BUILTIN git-push
    BUILTIN git-read-tree
    BUILTIN git-receive-pack
    BUILTIN git-reflog
    BUILTIN git-remote
    BUILTIN git-replace
    BUILTIN git-rerere
    BUILTIN git-reset
    BUILTIN git-rev-list
    BUILTIN git-rev-parse
    BUILTIN git-revert
    BUILTIN git-rm
    BUILTIN git-send-pack
    BUILTIN git-shortlog
    BUILTIN git-show-branch
    BUILTIN git-show-ref
    BUILTIN git-stripspace
    BUILTIN git-symbolic-ref
    BUILTIN git-tag
    BUILTIN git-tar-tree
    BUILTIN git-unpack-file
    BUILTIN git-unpack-objects
    BUILTIN git-update-index
    BUILTIN git-update-ref
    BUILTIN git-update-server-info
    BUILTIN git-upload-archive
    BUILTIN git-var
    BUILTIN git-verify-pack
    BUILTIN git-verify-tag
    BUILTIN git-write-tree
    BUILTIN git-cherry
    BUILTIN git-cherry-pick
    BUILTIN git-format-patch
    BUILTIN git-fsck-objects
    BUILTIN git-get-tar-commit-id
    BUILTIN git-init
    BUILTIN git-merge-subtree
    BUILTIN git-peek-remote
    BUILTIN git-repo-config
    BUILTIN git-show
    BUILTIN git-stage
    BUILTIN git-status
    BUILTIN git-whatchanged
    SUBDIR git-gui
GITGUI_VERSION = 0.12.0.64.g89d6
    * new locations or Tcl/Tk interpreter
    GEN git-gui
    INDEX lib/
    MSGFMT    po/de.msg 520 translated.
    MSGFMT    po/el.msg 381 translated, 4 fuzzy, 6 untranslated.
    MSGFMT    po/fr.msg 520 translated.
    MSGFMT    po/hu.msg 514 translated.
    MSGFMT    po/it.msg 519 translated, 1 untranslated.
    MSGFMT    po/ja.msg 520 translated.
    MSGFMT    po/nb.msg 474 translated, 39 untranslated.
    MSGFMT    po/ru.msg 513 translated, 2 untranslated.
    MSGFMT    po/sv.msg 520 translated.
    MSGFMT po/zh_cn.msg 366 translated, 7 fuzzy, 17 untranslated.
    SUBDIR gitk-git
    GEN gitk-wish
Generating catalog po/de.msg
msgfmt --statistics --tcl po/de.po -l de -d po/
289 translated messages.
Generating catalog po/es.msg
msgfmt --statistics --tcl po/es.po -l es -d po/
200 translated messages, 7 untranslated messages.
Generating catalog po/fr.msg
msgfmt --statistics --tcl po/fr.po -l fr -d po/
276 translated messages, 4 fuzzy translations.
Generating catalog po/hu.msg
msgfmt --statistics --tcl po/hu.po -l hu -d po/
288 translated messages.
Generating catalog po/it.msg
msgfmt --statistics --tcl po/it.po -l it -d po/
283 translated messages, 6 untranslated messages.
Generating catalog po/ja.msg
msgfmt --statistics --tcl po/ja.po -l ja -d po/
284 translated messages.
Generating catalog po/ru.msg
msgfmt --statistics --tcl po/ru.po -l ru -d po/
245 translated messages.
Generating catalog po/sv.msg
msgfmt --statistics --tcl po/sv.po -l sv -d po/
289 translated messages.
    SUBDIR perl
cp Git.pm blib/lib/Git.pm
Manifying blib/man3/Git.3pm
    SUBDIR git_remote_helpers
    SUBDIR templates
    CC test-chmtime.o
    LINK test-chmtime
    CC test-ctype.o
    LINK test-ctype
    CC test-date.o
    LINK test-date
    CC test-delta.o
    LINK test-delta
    CC test-dump-cache-tree.o
    LINK test-dump-cache-tree
    CC test-genrandom.o
    LINK test-genrandom
    CC test-match-trees.o
    LINK test-match-trees
    CC test-parse-options.o
    LINK test-parse-options
    CC test-path-utils.o
    LINK test-path-utils
    CC test-run-command.o
    LINK test-run-command
    CC test-sha1.o
    LINK test-sha1
    CC test-sigchain.o
    LINK test-sigchain
    CC test-index-version.o
    LINK test-index-version
    GEN bin-wrappers/git
    GEN bin-wrappers/git-upload-pack
    GEN bin-wrappers/git-receive-pack
    GEN bin-wrappers/git-upload-archive
    GEN bin-wrappers/git-shell
    GEN bin-wrappers/git-cvsserver
    GEN bin-wrappers/test-chmtime
    GEN bin-wrappers/test-ctype
    GEN bin-wrappers/test-date
    GEN bin-wrappers/test-delta
    GEN bin-wrappers/test-dump-cache-tree
    GEN bin-wrappers/test-genrandom
    GEN bin-wrappers/test-match-trees
    GEN bin-wrappers/test-parse-options
    GEN bin-wrappers/test-path-utils
    GEN bin-wrappers/test-run-command
    GEN bin-wrappers/test-sha1
    GEN bin-wrappers/test-sigchain
    GEN bin-wrappers/test-index-version
6.  Install Git.
6.1  Login as root.
6.2  [root]# cd /home/git0/git-source/git-1.6.3.4
6.3  [root]# make prefix=/usr install
6.3 SAMPLE of GOOD OUTPUT for 1.7.1 install:
[root]# make prefix=/usr install
    SUBDIR git-gui
    SUBDIR gitk-git
make[1]: Nothing to be done for `all'.
    SUBDIR perl
    SUBDIR git_remote_helpers
    SUBDIR templates
install -d -m 755 '/usr/bin'
install -d -m 755 '/usr/libexec/git-core'
install   git-fast-import git-imap-send git-shell git-show-index 
git-upload-pack
 git-http-backend git-http-fetch git-http-push git-daemon git-remote-http 
git-re
mote-https git-remote-ftp git-remote-ftps git-am git-bisect 
git-difftool--helper
 git-filter-branch git-lost-found git-merge-octopus git-merge-one-file 
git-merge
-resolve git-mergetool git-pull git-quiltimport git-rebase--interactive 
git-reba
se git-repack git-request-pull git-stash git-submodule git-web--browse 
git-add--
interactive git-difftool git-archimport git-cvsexportcommit git-cvsimport 
git-cv
sserver git-relink git-send-email git-svn  git-instaweb 
'/usr/libexec/git-core'
install -m 644  git-mergetool--lib git-parse-remote git-sh-setup 
'/usr/libexec/g
it-core'
install git git-upload-pack git-receive-pack git-upload-archive git-shell 
git-cv
sserver '/usr/bin'
make -C templates DESTDIR='' install
make[1]: Entering directory `/home/git0/git-source/git-1.7.1/templates'
install -d -m 755 '/usr/share/git-core/templates'
(cd blt && tar cf - .) | \
        (cd '/usr/share/git-core/templates' && umask 022 && tar xof -)
make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/templates'
make -C perl prefix='/usr' DESTDIR='' install
make[1]: Entering directory `/home/git0/git-source/git-1.7.1/perl'
make[2]: Entering directory `/home/git0/git-source/git-1.7.1/perl'
Installing /usr/lib/perl5/site_perl/5.8.8/Git.pm
Installing /usr/share/man/man3/Git.3pm
Writing 
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Git/.pac
klist
Appending installation info to 
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/
perllocal.pod
make[2]: Leaving directory `/home/git0/git-source/git-1.7.1/perl'
make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/perl'
make -C git_remote_helpers prefix='/usr' DESTDIR='' install
make[1]: Entering directory 
`/home/git0/git-source/git-1.7.1/git_remote_helpers'

/usr/bin/python setup.py install --prefix /usr
running install
running build
running build_py
running install_lib
copying build/lib/git_remote_helpers/git/git.py -> 
/usr/lib/python2.4/site-packa
ges/git_remote_helpers/git
copying build/lib/git_remote_helpers/git/__init__.py -> 
/usr/lib/python2.4/site-
packages/git_remote_helpers/git
copying build/lib/git_remote_helpers/util.py -> 
/usr/lib/python2.4/site-packages
/git_remote_helpers
copying build/lib/git_remote_helpers/__init__.py -> 
/usr/lib/python2.4/site-pack
ages/git_remote_helpers
byte-compiling 
/usr/lib/python2.4/site-packages/git_remote_helpers/git/git.py to
 git.pyc
byte-compiling 
/usr/lib/python2.4/site-packages/git_remote_helpers/git/__init__.
py to __init__.pyc
byte-compiling /usr/lib/python2.4/site-packages/git_remote_helpers/util.py 
to ut
il.pyc
byte-compiling 
/usr/lib/python2.4/site-packages/git_remote_helpers/__init__.py t
o __init__.pyc
make[1]: Leaving directory 
`/home/git0/git-source/git-1.7.1/git_remote_helpers'
make -C gitk-git install
make[1]: Entering directory `/home/git0/git-source/git-1.7.1/gitk-git'
install -m 755 gitk-wish '/usr/bin'/gitk
install -d -m 755 '/usr/share/gitk/lib/msgs'
install -m 644 po/de.msg '/usr/share/gitk/lib/msgs' &&  install -m 644 
po/es.msg
 '/usr/share/gitk/lib/msgs' &&  install -m 644 po/fr.msg 
'/usr/share/gitk/lib/ms
gs' &&  install -m 644 po/hu.msg '/usr/share/gitk/lib/msgs' &&  install -m 
644 p
o/it.msg '/usr/share/gitk/lib/msgs' &&  install -m 644 po/ja.msg 
'/usr/share/git
k/lib/msgs' &&  install -m 644 po/ru.msg '/usr/share/gitk/lib/msgs' && 
install
-m 644 po/sv.msg '/usr/share/gitk/lib/msgs' && true
make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/gitk-git'
make -C git-gui gitexecdir='/usr/libexec/git-core' install
make[1]: Entering directory `/home/git0/git-source/git-1.7.1/git-gui'
  DEST /usr/libexec/git-core
    INSTALL 755 git-gui
    INSTALL 755 git-gui--askpass
    LINK        git-citool -> git-gui
  DEST /usr/share/git-gui/lib
    INSTALL 644 tclIndex
    INSTALL 644 about.tcl
    INSTALL 644 blame.tcl
    INSTALL 644 branch.tcl
    INSTALL 644 branch_checkout.tcl
    INSTALL 644 branch_create.tcl
    INSTALL 644 branch_delete.tcl
    INSTALL 644 branch_rename.tcl
    INSTALL 644 browser.tcl
    INSTALL 644 checkout_op.tcl
    INSTALL 644 choose_font.tcl
    INSTALL 644 choose_repository.tcl
    INSTALL 644 choose_rev.tcl
    INSTALL 644 class.tcl
    INSTALL 644 commit.tcl
    INSTALL 644 console.tcl
    INSTALL 644 database.tcl
    INSTALL 644 date.tcl
    INSTALL 644 diff.tcl
    INSTALL 644 encoding.tcl
    INSTALL 644 error.tcl
    INSTALL 644 index.tcl
    INSTALL 644 logo.tcl
    INSTALL 644 merge.tcl
    INSTALL 644 mergetool.tcl
    INSTALL 644 option.tcl
    INSTALL 644 remote.tcl
    INSTALL 644 remote_add.tcl
    INSTALL 644 remote_branch_delete.tcl
    INSTALL 644 search.tcl
    INSTALL 644 shortcut.tcl
    INSTALL 644 spellcheck.tcl
    INSTALL 644 sshkey.tcl
    INSTALL 644 status_bar.tcl
    INSTALL 644 themed.tcl
    INSTALL 644 tools.tcl
    INSTALL 644 tools_dlg.tcl
    INSTALL 644 transport.tcl
    INSTALL 644 win32.tcl
    INSTALL 644 git-gui.ico
    INSTALL 644 win32_shortcut.js
  DEST /usr/share/git-gui/lib/msgs
    INSTALL 644 de.msg
    INSTALL 644 el.msg
    INSTALL 644 fr.msg
    INSTALL 644 hu.msg
    INSTALL 644 it.msg
    INSTALL 644 ja.msg
    INSTALL 644 nb.msg
    INSTALL 644 ru.msg
    INSTALL 644 sv.msg
    INSTALL 644 zh_cn.msg
make[1]: Leaving directory `/home/git0/git-source/git-1.7.1/git-gui'
bindir=$(cd '/usr/bin' && pwd) && \
        execdir=$(cd '/usr/libexec/git-core' && pwd) && \
        { test "$bindir/" = "$execdir/" || \
                { rm -f "$execdir/git" && \
                test -z "" && \
                ln "$bindir/git" "$execdir/git" 2>/dev/null || \
                cp "$bindir/git" "$execdir/git"; } ; } && \
        { for p in  git-add git-annotate git-apply git-archive 
git-bisect--helpe
r git-blame git-branch git-bundle git-cat-file git-check-attr 
git-check-ref-form
at git-checkout-index git-checkout git-clean git-clone git-commit-tree 
git-commi
t git-config git-count-objects git-describe git-diff-files git-diff-index 
git-di
ff-tree git-diff git-fast-export git-fetch-pack git-fetch git-fmt-merge-msg 
git-
for-each-ref git-fsck git-gc git-grep git-hash-object git-help 
git-index-pack gi
t-init-db git-log git-ls-files git-ls-remote git-ls-tree git-mailinfo 
git-mailsp
lit git-merge git-merge-base git-merge-file git-merge-index git-merge-ours 
git-m
erge-recursive git-merge-tree git-mktag git-mktree git-mv git-name-rev 
git-notes
 git-pack-objects git-pack-redundant git-pack-refs git-patch-id 
git-prune-packed
 git-prune git-push git-read-tree git-receive-pack git-reflog git-remote 
git-rep
lace git-rerere git-reset git-rev-list git-rev-parse git-revert git-rm 
git-send-
pack git-shortlog git-show-branch git-show-ref git-stripspace 
git-symbolic-ref g
it-tag git-tar-tree git-unpack-file git-unpack-objects git-update-index 
git-upda
te-ref git-update-server-info git-upload-archive git-var git-verify-pack 
git-ver
ify-tag git-write-tree git-cherry git-cherry-pick git-format-patch 
git-fsck-obje
cts git-get-tar-commit-id git-init git-merge-subtree git-peek-remote 
git-repo-co
nfig git-show git-stage git-status git-whatchanged; do \
                rm -f "$execdir/$p" && \
                ln "$execdir/git" "$execdir/$p" 2>/dev/null || \
                ln -s "git" "$execdir/$p" 2>/dev/null || \
                cp "$execdir/git" "$execdir/$p" || exit; \
          done; } && \
        { for p in git-remote-https git-remote-ftp git-remote-ftps; do \
                rm -f "$execdir/$p" && \
                ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || \
                ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
                cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
          done; } && \
        ./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
[root]#
7.  Validate Git.
7.1  See what version of git is installed.
[neal]$ git --version
7.2  See where git is installed.
[neal]$ git --exec-path
7.3  VNC to gui desktop.
Open Terminal.
[neal]$ gitk  validate that gitk executes and displays.
[neal]$ git gui  validate that git gui executes and displays.
Note:  Only after you have a local repository working tree can you can 
validate xdg-utils as follows:
<Repository> -> <Browse Master's Files>  validate's xdg-utils.


GIT INSTALL.  PART 2.  INSTALL GIT RELATED TOOLS.
1.  Install KDiff3.  Merge tool.
1.1  [root]# yum list kdiff3  (See if its already installed.)
1.2  [root]# yum install kdiff3  (Install it if it is not already 
installed.)
1.3  [root]# yum list kdiff3  (Verify that it is installed.)
1.3  SAMPLE OUTPUT:
kdiff3.x86_64                      0.9.92-14.el5 
installed


Like I said, this is what has worked for me.  Hope this helps!

(If anyone has any *PROVEN* improvements and/or additions to my procedures 
then by all means let me know...)


v/r,
Neal 

^ permalink raw reply

* Re: [PATCHv3 6/6] web--browse: look at the BROWSER env var
From: Giuseppe Bilotta @ 2010-12-06 18:28 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano, Christian Couder
In-Reply-To: <20101206175914.GD6272@burratino>

On Mon, Dec 6, 2010 at 6:59 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Giuseppe Bilotta wrote:
>
>> The BROWSER environment variables is used in Debian-based systems to set
>> the user-preferred browser(s).
>
> I _thought_ BROWSER was not Debian-specific, but I cannot find any
> evidence of that online.  See:
>
>  http://www.catb.org/~esr/BROWSER/
>  http://www.dwheeler.com/browse/secure_browser.html
>
> At least xdg-open implements a variant on it, and I had assumed
> apps preceding xdg-utils did, too.

IIRC, RedHat's sensible-browser equivalent, htmlview, used to use
BROWSER. The package is now obsolete, though, and I'm not even sure it
used BROWSER at all in its latest incarnations.

xdg-open _does_ use BROWSER though. So maybe I should clear the
Debian-specificity of this patch.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply

* Re: [PATCHv3 6/6] web--browse: look at the BROWSER env var
From: Jonathan Nieder @ 2010-12-06 17:59 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: git, Junio C Hamano, Christian Couder
In-Reply-To: <1291657790-3719-7-git-send-email-giuseppe.bilotta@gmail.com>

Giuseppe Bilotta wrote:

> The BROWSER environment variables is used in Debian-based systems to set
> the user-preferred browser(s).

I _thought_ BROWSER was not Debian-specific, but I cannot find any
evidence of that online.  See:

 http://www.catb.org/~esr/BROWSER/
 http://www.dwheeler.com/browse/secure_browser.html

At least xdg-open implements a variant on it, and I had assumed
apps preceding xdg-utils did, too.

^ permalink raw reply

* Re: git reset and ctime
From: Jonathan Nieder @ 2010-12-06 17:51 UTC (permalink / raw)
  To: Drew Northup; +Cc: ghazel, git, Junio C Hamano
In-Reply-To: <1291657037.30271.17.camel@drew-northup.unet.maine.edu>

Drew Northup wrote:
> On Fri, 2010-12-03 at 18:51 -0600, Jonathan Nieder wrote:

>> Interesting.  Setting "[core] trustctime = false" in the repository
>> configuration could be a good solution (no performance downside I can
>> think of).
>
> It is worth noting that many file-based backup systems which do "online"
> backups (such as in use where I work) restore the atime by default at
> the expense of the ctime (logic being that the atime may have had value
> and the ctime changes either way--which may or may not be true) on unix
> style filesystems.

So have you tried putting "[core] trustctime = false" in /etc/gitconfig?
This is exactly what the setting is for, after all.

Ideas for making this easier to find (FAQ on the git wiki?  advice from
porcelain when ctime-only changes happen?) would be welcome, of course.

^ permalink raw reply

* [PATCHv3 0/6] web--browse cleanup and extensions
From: Giuseppe Bilotta @ 2010-12-06 17:49 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Christian Couder, Jonathan Nieder,
	Giuseppe Bilotta

Differences from the previous revision of this patchset:

* the CodingGuidelines patch was dropped, since it's merged in next
* the chromium support patch had some stylistic changes suggested by Junio
* the *www-browser patch adds support for detecting konqueror and kfmclient,
  which required some changes to the version string retrieval code; also,
  readlink is only used if available.

Giuseppe Bilotta (6):
  web--browse: coding style
  web--browse: split valid_tool list
  web--browse: support opera, seamonkey and elinks
  web--browse: better support for chromium
  web--browse: use *www-browser if available
  web--browse: look at the BROWSER env var

 Documentation/git-web--browse.txt |   10 ++
 git-web--browse.sh                |  302 ++++++++++++++++++++++++++-----------
 2 files changed, 225 insertions(+), 87 deletions(-)

-- 
1.7.3.2.664.g294b8.dirty

^ permalink raw reply

* [PATCHv3 6/6] web--browse: look at the BROWSER env var
From: Giuseppe Bilotta @ 2010-12-06 17:49 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Christian Couder, Jonathan Nieder,
	Giuseppe Bilotta
In-Reply-To: <1291657790-3719-1-git-send-email-giuseppe.bilotta@gmail.com>

The BROWSER environment variables is used in Debian-based systems to set
the user-preferred browser(s).

It contains a colon-separate list of commands to (try to) execute
to open a web page. Each item in the list is allowed to have a %s
placeholder to be replaced by the URL, in which case we try to run the
command as is. If no placeholder is found, we only look at the command
name to see if it matches one of our known browsers.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 git-web--browse.sh |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/git-web--browse.sh b/git-web--browse.sh
index b496b6c..da36ca4 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -164,6 +164,51 @@ then
 	fi
 fi
 
+# Debian and derivatives provide a sensible-brower script that tries to
+# invoke the user or system preferred browser most appropriate for the
+# current situation (X or no X, GNOME or other/no DE).
+# We do not use the sensible-browser script directly since it doesn't
+# allow us to open pages in a new tab, but we can use the underlying
+# infrastructure to find the browser to use if the user didn't choose
+# one. This is done by looking at the BROWSER environment variable
+# first, and at the *www-browser links if the first search is
+# unsuccesful.
+
+# The BROWSER environment variable is a colon-separate list of commands
+# to (try and) execute to launch the browser. sensible-browser allows
+# each BROWSER entry to contain a %s placeholder that will be replaced
+# by the URL to be opened.
+# If an entry contains a %s we run it as-is, without doing any detection, on
+# the premise that it represents the exact way the user expects the browser to
+# be called. If the execution fails, we do not bail out, since the
+# failure might be due to the entry being for a graphical browser and
+# the GUI not being available, which is the reason why multiple entries
+# can be specified in BROWSER in the first place.
+# An entry without a %s is only taken as indication of the preferred
+# browser, so we proceed with our usual detection logic.
+if test -z "$browser" -a -n "$BROWSER"; then
+	OLDIFS="$IFS"
+	IFS=:
+	for i in $BROWSER; do
+		case "$i" in
+			*sensible-browser*)
+				;; # skip
+			*%s*)
+				IFS="$OLDIFS"
+				cmd=$(printf "$i\n" "$*")
+				$cmd && exit 0
+				;;
+			*)
+				prog=$(which "$i" 2> /dev/null)
+				if test -n "$prog" -a -x "$prog" && valid_browser_executable "$prog" ; then
+					break
+				fi
+				;;
+		esac
+	done
+	IFS="$OLDIFS"
+fi
+
 # Debian and derivatives use gnome-www-browser, x-www-browser or www-browser to
 # set the default browser for the system. If the user did not specify a tool and
 # we detect that one of the *www-browser links to a supported one, we pick it.
-- 
1.7.3.2.664.g294b8.dirty

^ permalink raw reply related

* [PATCHv3 5/6] web--browse: use *www-browser if available
From: Giuseppe Bilotta @ 2010-12-06 17:49 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Christian Couder, Jonathan Nieder,
	Giuseppe Bilotta
In-Reply-To: <1291657790-3719-1-git-send-email-giuseppe.bilotta@gmail.com>

Debian and derivatives have an alternatives-based default browser
configuration that uses the /usr/bin/gnome-www-browser,
/usr/bin/x-www-browser and /usr/bin/www-browser symlinks.

When no browser is selected by the user and the Debian alternatives are
available, try to see if they are one of our recognized selection and
in the affermative case use it. Otherwise, warn the user about them
being unsupported and move on with the previous detection logic.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 Documentation/git-web--browse.txt |    4 ++
 git-web--browse.sh                |   84 +++++++++++++++++++++++++++++++++++-
 2 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-web--browse.txt b/Documentation/git-web--browse.txt
index c0416e5..157738a 100644
--- a/Documentation/git-web--browse.txt
+++ b/Documentation/git-web--browse.txt
@@ -36,6 +36,10 @@ The following browsers (or commands) are currently supported:
 
 Custom commands may also be specified.
 
+If no default browser is specified, and /usr/bin/gnome-www-browser
+(under GNOME), /usr/bin/x-www-browser (under X) or /usr/bin/www-browser
+is present, they are used to determine the browser to use.
+
 OPTIONS
 -------
 -b <browser>::
diff --git a/git-web--browse.sh b/git-web--browse.sh
index b2fc3b4..b496b6c 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -50,6 +50,63 @@ init_browser_path() {
 	test -z "$browser_path" && browser_path="$1"
 }
 
+# check if a given executable is a browser we like
+valid_browser_executable() {
+	testexe="$1"
+
+	# check the executable name first, trying to follow symlinks if possible
+	if type readlink > /dev/null 2>&1 ; then
+		basename="$(basename $(readlink -f "$testexe"))"
+	else
+		basename="$(basename "$testexe")"
+	fi
+	if valid_tool "$basename" ; then
+		browser="$basename"
+		browser_path="$testexe"
+		return 0
+	fi
+
+	# if the linked executable doesn't match a browser name we know about,
+	# look at the version string
+
+	# even though most browsers (and applications, in fact) will show their
+	# name and version on the first line of the --version output, this is
+	# not true in particular for the KDE apps (e.g. konqueror and kfmclient),
+	# which display their name and version on the LAST line. So we cannot
+	# clip the version string at the first line when retrieving it. Rather,
+	# we keep it whole and then limit it when we know what we're dealing with.
+
+	verstring="$("$testexe" --version 2> /dev/null)"
+	browser="$(echo "$verstring" | head -n 1 | cut -f1 -d' ' | tr A-Z a-z)"
+	case "$browser" in
+		mozilla)
+			verstring="$(echo "$verstring" | head -n 1)"
+			browser="$(echo "$verstring" | cut -f2 -d' ' | tr A-Z a-z)"
+			;;
+		google)
+			verstring="$(echo "$verstring" | head -n 1)"
+			browser="google-chrome"
+			;;
+		qt:)
+			# konqueror, kfmclient or other KDE app
+			verstring="$(echo "$verstring" | tail -n 1)"
+			browser="$(echo "$verstring" | cut -f1 -d:)"
+			;;
+		*)
+			verstring="$(echo "$verstring" | head -n 1)"
+			;;
+
+	esac
+	if valid_tool "$browser" ; then
+		browser_path="$i"
+		return 0
+	fi
+
+	echo >&2 "$testexe (detected as $browser) is not a supported browser, skipping"
+	browser=""
+	return 1
+}
+
 while test $# != 0
 do
 	case "$1" in
@@ -107,6 +164,26 @@ then
 	fi
 fi
 
+# Debian and derivatives use gnome-www-browser, x-www-browser or www-browser to
+# set the default browser for the system. If the user did not specify a tool and
+# we detect that one of the *www-browser links to a supported one, we pick it.
+# Otherwise, we warn the user about them being unsupported and proceed to look
+# for a supported browser.
+if test -z "$browser" ; then
+	wwwbrowser="/usr/bin/www-browser"
+	if test -n "$DISPLAY"; then
+		wwwbrowser="/usr/bin/x-www-browser $wwwbrowser"
+		if test -n "$GNOME_DESKTOP_SESSION_ID"; then
+			wwwbrowser="/usr/bin/gnome-www-browser $wwwbrowser"
+		fi
+	fi
+	for i in $wwwbrowser; do
+		if test -x $i && valid_browser_executable $i ; then
+			break
+		fi
+	done
+fi
+
 if test -z "$browser" ; then
 	if test -n "$DISPLAY"; then
 		browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo"
@@ -134,7 +211,7 @@ if test -z "$browser" ; then
 		fi
 	done
 	test -z "$browser" && die "No known browser available."
-else
+else if test -z "$browser_path"; then
 	valid_tool "$browser" || die "Unknown browser '$browser'."
 
 	init_browser_path "$browser"
@@ -142,12 +219,13 @@ else
 	if test -z "$browser_cmd" && ! type "$browser_path" > /dev/null 2>&1; then
 		die "The browser $browser is not available as '$browser_path'."
 	fi
-fi
+fi fi
 
 case "$browser" in
 firefox|iceweasel|seamonkey|iceape)
 	# Check version because firefox < 2.0 does not support "-new-tab".
-	vers=$(expr "$($browser_path -version)" : '.* \([0-9][0-9]*\)\..*')
+	test -z "$verstring" && verstring="$($browser_path -version)"
+	vers=$(expr "$verstring" : '.* \([0-9][0-9]*\)\..*')
 	NEWTAB='-new-tab'
 	test "$vers" -lt 2 && NEWTAB=''
 	"$browser_path" $NEWTAB "$@" &
-- 
1.7.3.2.664.g294b8.dirty

^ permalink raw reply related


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