Git development
 help / color / mirror / Atom feed
* [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool
From: Dan McGee @ 2007-06-06  1:38 UTC (permalink / raw)
  To: git; +Cc: Dan McGee

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
 Documentation/config.txt        |    2 +-
 Documentation/git-mergetool.txt |    2 +-
 git-mergetool.sh                |    6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d58..3ca01af 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -531,7 +531,7 @@ merge.summary::
 merge.tool::
 	Controls which merge resolution program is used by
 	gitlink:git-mergetool[l].  Valid values are: "kdiff3", "tkdiff",
-	"meld", "xxdiff", "emerge", "vimdiff", and "opendiff"
+	"meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and "opendiff".
 
 merge.verbosity::
 	Controls the amount of output shown by the recursive merge
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index add01e8..34c4c1c 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -25,7 +25,7 @@ OPTIONS
 -t or --tool=<tool>::
 	Use the merge resolution program specified by <tool>.
 	Valid merge tools are:
-	kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff
+	kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff
 +
 If a merge resolution program is not specified, 'git mergetool'
 will use the configuration variable merge.tool.  If the
diff --git a/git-mergetool.sh b/git-mergetool.sh
index e62351b..1e4807b 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -209,7 +209,7 @@ merge_file () {
 	    status=$?
 	    save_backup
 	    ;;
-	meld|vimdiff)
+	meld|vimdiff|gvimdiff)
 	    touch "$BACKUP"
 	    $merge_tool -- "$LOCAL" "$path" "$REMOTE"
 	    check_unchanged
@@ -293,7 +293,7 @@ done
 if test -z "$merge_tool"; then
     merge_tool=`git-config merge.tool`
     case "$merge_tool" in
-	kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | "")
+	kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | "")
 	    ;; # happy
 	*)
 	    echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
@@ -325,7 +325,7 @@ if test -z "$merge_tool" ; then
 fi
 
 case "$merge_tool" in
-    kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)
+    kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)
 	if ! type "$merge_tool" > /dev/null 2>&1; then
 	    echo "The merge tool $merge_tool is not available"
 	    exit 1
-- 
1.5.2.1

^ permalink raw reply related

* [PATCH] Remove useless uses of cat, and replace with filename arguments or redirection
From: Josh Triplett @ 2007-06-06  1:34 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 3447 bytes --]

Replace all uses of cat that do nothing other than read a single file.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
 git-commit.sh        |    2 +-
 git-filter-branch.sh |    4 ++--
 git-ls-remote.sh     |    2 +-
 git-quiltimport.sh   |    4 ++--
 git-verify-tag.sh    |    3 +--
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/git-commit.sh b/git-commit.sh
index e8b60f7..06b6cd7 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -617,7 +617,7 @@ then
 		tree=$(GIT_INDEX_FILE="$TMP_INDEX" git-write-tree) &&
 		rm -f "$TMP_INDEX"
 	fi &&
-	commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
+	commit=$(git-commit-tree $tree $PARENTS < "$GIT_DIR"/COMMIT_MSG) &&
 	rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
 	git-update-ref -m "$GIT_REFLOG_ACTION: $rlogm" HEAD $commit "$current" &&
 	rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" &&
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0c8a7df..bfac6f2 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -333,7 +333,7 @@ for commit in $unchanged; do
 done
 
 git-rev-list --reverse --topo-order $srcbranch --not $unchanged >../revs
-commits=$(cat ../revs | wc -l | tr -d " ")
+commits=$(wc -l ../revs | tr -d " ")
 
 test $commits -eq 0 && die "Found nothing to rewrite"
 
@@ -386,7 +386,7 @@ while read commit; do
 done <../revs
 
 git-update-ref refs/heads/"$dstbranch" $(head -n 1 ../map/$(tail -n 1 ../revs))
-if [ "$(cat ../map/$(tail -n 1 ../revs) | wc -l)" -gt 1 ]; then
+if [ "$(wc -l ../map/$(tail -n 1 ../revs))" -gt 1 ]; then
 	echo "WARNING: Your commit filter caused the head commit to expand to several rewritten commits. Only the first such commit was recorded as the current $dstbranch head but you will need to resolve the situation now (probably by manually merging the other commits). These are all the commits:" >&2
 	sed 's/^/	/' ../map/$(tail -n 1 ../revs) >&2
 	ret=1
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index a6ed99a..f5b2e77 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -82,7 +82,7 @@ rsync://* )
 	(cd $tmpdir && find refs -type f) |
 	while read path
 	do
-		cat "$tmpdir/$path" | tr -d '\012'
+		tr -d '\012' < "$tmpdir/$path"
 		echo "	$path"
 	done &&
 	rm -fr $tmpdir
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index a7a6757..bd540cd 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -70,9 +70,9 @@ tmp_info="$tmp_dir/info"
 commit=$(git-rev-parse HEAD)
 
 mkdir $tmp_dir || exit 2
-for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do
+for patch_name in $(grep -v '^#' "$QUILT_PATCHES/series"); do
 	echo $patch_name
-	(cat $QUILT_PATCHES/$patch_name | git-mailinfo "$tmp_msg" "$tmp_patch" > "$tmp_info") || exit 3
+	git-mailinfo "$tmp_msg" "$tmp_patch" < "$QUILT_PATCHES/$patch_name" > "$tmp_info" || exit 3
 	test -s .dotest/patch || {
 		echo "Patch is empty.  Was it split wrong?"
 		exit 1
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
index 8db7dd0..11ce947 100755
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -38,8 +38,7 @@ trap 'rm -f "$GIT_DIR/.tmp-vtag"' 0
 
 git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
 
-cat "$GIT_DIR/.tmp-vtag" |
-sed '/-----BEGIN PGP/Q' |
+sed '/-----BEGIN PGP/Q' "$GIT_DIR/.tmp-vtag" |
 gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
 rm -f "$GIT_DIR/.tmp-vtag"
 
-- 
1.5.2.1



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply related

* [PATCH] remote: add 'rm' subcommand
From: James Bowes @ 2007-06-05 23:25 UTC (permalink / raw)
  To: junkio, git

Introduce git-remote rm <name> which will:
 - Remove the remote config entry for <name>.
 - Remove any config entries for tracking branches of <name>.
 - Remove any stored remote branches of <name>.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---

Here's a quick patch to implement the reverse of 'git-remote add', as
was asked about recently on the list[1]. Tested minimally with a
collection of on-disk repositories.

If there is any interest in this, I'll follow up later with additions
to the docs.

-James

[1] http://article.gmane.org/gmane.comp.version-control.git/49222

 git-remote.perl |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 5763799..05aa8d6 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -313,6 +313,34 @@ sub update_remote {
 	}
 }
 
+sub rm_remote {
+    my ($name) = @_;
+	if (!exists $remote->{$name}) {
+		print STDERR "No such remote $name\n";
+		return;
+	}
+
+	$git->command('config', '--remove-section', "remote.$name");
+
+	eval {
+	    my @trackers = $git->command('config', '--get-regexp',
+			'branch.*.remote', $name);
+		for (@trackers) {
+			/^branch\.(.*)?\.remote/;
+			$git->config('--unset', "branch.$1.remote");
+			$git->config('--unset', "branch.$1.merge");
+		}
+	};
+
+
+    my @refs = $git->command('for-each-ref',
+		'--format=%(refname) %(objectname)', "refs/remotes/$name");
+	for (@refs) {
+		($ref, $object) = split;
+		$git->command(qw(update-ref -d), $ref, $object);
+	}
+}
+
 sub add_usage {
 	print STDERR "Usage: git remote add [-f] [-t track]* [-m master] <name> <url>\n";
 	exit(1);
@@ -403,9 +431,19 @@ elsif ($ARGV[0] eq 'add') {
 	}
 	add_remote($ARGV[1], $ARGV[2], \%opts);
 }
+elsif ($ARGV[0] eq 'rm') {
+	if (@ARGV <= 1) {
+		print STDERR "Usage: git remote rm <remote>\n";
+	}
+    else {
+        rm_remote($ARGV[1]);
+	}
+    exit(1);
+}
 else {
 	print STDERR "Usage: git remote\n";
 	print STDERR "       git remote add <name> <url>\n";
+	print STDERR "       git remote rm <name>\n";
 	print STDERR "       git remote show <name>\n";
 	print STDERR "       git remote prune <name>\n";
 	print STDERR "       git remote update [group]\n";
-- 
1.5.2.1.851.g432c

^ permalink raw reply related

* Re: [PATCH] Fix typo in remote branch example in git user manual
From: J. Bruce Fields @ 2007-06-05 22:46 UTC (permalink / raw)
  To: Junio C Hamano, git
In-Reply-To: <20070605084751.23322.qmail@fcde833ae749fc.315fe32.mid.smarden.org>

On Tue, Jun 05, 2007 at 08:47:51AM +0000, Gerrit Pape wrote:
> In Documentation/user-manual.txt the example
>  $ git checkout --track -b origin/maint maint
> under "Getting updates with git pull", should read
>  $ git checkout --track -b maint origin/maint

Yep, thanks for the fix!--b.

^ permalink raw reply

* Re: [PATCH] $EMAIL is a last resort fallback, as it's system-wide.
From: Pierre Habouzit @ 2007-06-05 22:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <11810823351883-git-send-email-madcoder@debian.org>

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

  Eeeew sorry for the repost, I sent the bad patch with git send-email.
my mistake.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] Documentation typo.
From: Pierre Habouzit @ 2007-06-05 22:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Pierre Habouzit

From: Pierre Habouzit <pierre.habouzit@m4x.org>

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 Documentation/pull-fetch-param.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 8d4e950..5bcdbc8 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -4,7 +4,7 @@
 
 <refspec>::
 	The canonical format of a <refspec> parameter is
-	`+?<src>:<dst>`; that is, an optional plus `+`, followed
+	`\+?<src>:<dst>`; that is, an optional plus `+`, followed
 	by the source ref, followed by a colon `:`, followed by
 	the destination ref.
 +
-- 
1.5.2.1

^ permalink raw reply related

* [PATCH] $EMAIL is a last resort fallback, as it's system-wide.
From: Pierre Habouzit @ 2007-06-05 22:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Pierre Habouzit

From: Pierre Habouzit <pierre.habouzit@m4x.org>

  Rationale: $EMAIL is a system-wide setup that is used for many many many
applications. If the git user chose a specific user.email setup, then _this_
should be honoured rather than $EMAIL.

Signed-off-by: Pierre Habouzit <pierre.habouzit@m4x.org>
---
 ident.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ident.c b/ident.c
index 69a04b8..3d49608 100644
--- a/ident.c
+++ b/ident.c
@@ -196,9 +196,9 @@ const char *fmt_ident(const char *name, const char *email,
 	if (!name)
 		name = git_default_name;
 	if (!email)
-		email = getenv("EMAIL");
-	if (!email)
 		email = git_default_email;
+	if (!email)
+		email = getenv("EMAIL");
 
 	if (!*name) {
 		struct passwd *pw;
-- 
1.5.2.1

^ permalink raw reply related

* [PATCH] New selection indication and softer colors
From: Matthijs Melchior @ 2007-06-05 21:50 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git, Matthijs Melchior

The default font was already bold, so marking the selected file with bold
font did not work.  Change that to lightgray background.
Also, the header colors are now softer, giving better readability.

Signed-off-by: Matthijs Melchior <mmelchior@xs4all.nl>
---

This gives better colors on my Debian Gnome desktop.

I hope you like it too.

 git-gui.sh |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index d4ad73c..e33ee03 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1764,7 +1764,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
 #
 frame .vpane.files.index -height 100 -width 200
 label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
-	-background green
+	-background lightgreen
 text $ui_index -background white -borderwidth 0 \
 	-width 20 -height 10 \
 	-wrap none \
@@ -1784,7 +1784,7 @@ pack $ui_index -side left -fill both -expand 1
 #
 frame .vpane.files.workdir -height 100 -width 200
 label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
-	-background red
+	-background lightsalmon
 text $ui_workdir -background white -borderwidth 0 \
 	-width 20 -height 10 \
 	-wrap none \
@@ -1801,10 +1801,8 @@ pack $ui_workdir -side left -fill both -expand 1
 .vpane.files add .vpane.files.workdir -sticky nsew
 
 foreach i [list $ui_index $ui_workdir] {
-	$i tag conf in_diff -font font_uibold
-	$i tag conf in_sel \
-		-background [$i cget -foreground] \
-		-foreground [$i cget -background]
+	$i tag conf in_diff -background lightgray
+	$i tag conf in_sel  -background lightgray
 }
 unset i
 
@@ -1962,18 +1960,18 @@ proc trace_current_diff_path {varname args} {
 }
 trace add variable current_diff_path write trace_current_diff_path
 
-frame .vpane.lower.diff.header -background orange
+frame .vpane.lower.diff.header -background gold
 label .vpane.lower.diff.header.status \
-	-background orange \
+	-background gold \
 	-width $max_status_desc \
 	-anchor w \
 	-justify left
 label .vpane.lower.diff.header.file \
-	-background orange \
+	-background gold \
 	-anchor w \
 	-justify left
 label .vpane.lower.diff.header.path \
-	-background orange \
+	-background gold \
 	-anchor w \
 	-justify left
 pack .vpane.lower.diff.header.status -side left
-- 
1.5.2.1

^ permalink raw reply related

* Re: Improved git-gui blame viewer
From: Matthijs Melchior @ 2007-06-05 21:47 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20070605042855.GA9513@spearce.org>

Shawn O. Pearce wrote:
> Matthijs Melchior <mmelchior@xs4all.nl> wrote:
>   
>> Shawn O. Pearce wrote:
>>     
>>> I'm not sure I understand what you are looking for here.  Right now
>>> git-gui should be inverting the foreground/background colors on
>>> the file that is "selected" (shown in the lower diff view pane).
>>> So the background should be black, and the foreground white.
>>> Is this not happening?  Or are you looking for something else?
>>>
>>>       
>> No, I am not looking for something else...., the inverting you describe
>> does not happen on my machine....
>>     
>
> I'm wrong.  Its not inverting.  Its bold if its selected, and normal
> if its not selected.  Perhaps your font is already a bold weight
> so you aren't seeing a difference between the selected item and
> the non-selected items.
>  
>   
>> I am now running Debian git-core 1.5.2.1-1 with 'make install' done
>> in the origin/pu branch of git-gui.
>> 'About git-gui' now says:
>> 	git-gui version 0.7.2.58-gf9e9
>> 	git version 1.5.2.1
>> 	Tcl/Tk version 8.4.12
>>
>> If you explain where this inverting is taking place, I can do some
>> experiments to find out more [use gray background i.s.o. inverting...]
>> Maybe it has something to do with Desktop themes, I use the standard
>> Gnome theme.
>>     
>
> Around line 1803 of git-gui.sh we setup the in_diff tag for the
> $ui_index and $ui_workdir Tk widgets.  That tag is applied to the
> file that is in the diff viewer.  Perhaps adding a background to
> the tag would get you an improved interface?
>   
Yes, this is the problem.

I will send you a patch to change the background of the selected file
to lightgray.

I have included in that patch some softer colors for the headers of
the three involved widgets. I hope you like these.

Thanks.

-- 
Regards,
----------------------------------------------------------------  -o)
Matthijs Melchior                                       Maarssen  /\\
mmelchior@xs4all.nl                                  Netherlands _\_v
---------------------------------------------------------------- ----

^ permalink raw reply

* RE: How to remove invalid remote repository
From: Matt Seitz @ 2007-06-05 20:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <alpine.LFD.0.98.0706051308090.4921@woody.linux-foundation.org>

From: Linus Torvalds [mailto:torvalds@linux-foundation.org] 
> Well, this is because you apparently didn't call the remote 
> "origin", but something else. So when you do
> 
> 	git fetch
> 
> without giving any remote name at all, git will *default* to 
> using "origin" as a remote,

Ah, I see now.  I misread that section of the "Git User's Manual".
Using 

git fetch root-etc

worked fine.

Sorry to have bothered everyone with my error.

^ permalink raw reply

* Re: [PATCH 1/2] Show html help with git-help --html
From: Junio C Hamano @ 2007-06-05 20:40 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git
In-Reply-To: <20070605183420.GA8450@localhost>

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> This patch was inspired by ClearCase command 'ct man',...

> diff --git a/help.c b/help.c
> index 6a9af4d..78b1023 100644
> --- a/help.c
> +++ b/help.c
> @@ -9,6 +9,14 @@
>  #include "common-cmds.h"
>  #include <sys/ioctl.h>
>  
> +#ifndef HTML_DIR
> +#define HTML_DIR "/usr/share/html/"
> +#endif
> +
> +#ifndef HTML_PROGRAM
> +#define HTML_PROGRAM "xdg-open"
> +#endif
> +
>  /* most GUI terminals set COLUMNS (although some don't export it) */
>  static int term_columns(void)
>  {
> @@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd)
>  	execlp("man", "man", page, NULL);
>  }
>  
> +static void show_html_page(const char *git_cmd)
> +{
> +	const char *html_dir;
> +	int len, ret, nr_quotes;
> +	char *p, *p2;
> +	const char *cp, *cp2;
> +	struct stat st;
> +	char *quoted_git_cmd;
> +	char *default_command = NULL;
> +	const char *command;
>...
> +	/* append %p if there is not any %x */
> +	if (!strchr(command, '%')) {
> +		len = strlen(command);
> +		default_command = xmalloc(len + 3 + 1); /* space %p */
> +		strcpy(default_command, command);
> +		strcat(default_command, " %p");
> +		command = default_command;
> +	}
> +
> +	/* first pass, calculate command length */
> ...

Hmmm.  Makes one wonder why interpolate is not used....

^ permalink raw reply

* Re: [PATCH] filter-branch: always export GIT_DIR if it is set
From: Junio C Hamano @ 2007-06-05 20:39 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: Johannes Schindelin, git
In-Reply-To: <Pine.LNX.4.64.0706051823140.4046@racer.site>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Tue, 5 Jun 2007, Matthias Lederhofer wrote:
>
>> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
>> index 0c8a7df..f4cfbea 100644
>> --- a/git-filter-branch.sh
>> +++ b/git-filter-branch.sh
>> @@ -313,9 +313,12 @@ workdir="$(pwd)"
>>  
>>  case "$GIT_DIR" in
>>  /*)
>> +	export GIT_DIR
>> +	export GIT_WORK_TREE=.
>>  	;;
>
> Doesn't it strike somebody else as intrusive, if GIT_WORK_TREE has to 
> touch that many places?
>
> IMHO there should be a less intrusive, and possibly simpler, way to do it. 
> I am not at all interested in that feature, and I don't want to suffer 
> bugs from it either.

I suspect "bug" might be a bit too strong a word here, but this
definitely shows that work-tree series has a change of behaviour
that is subtle on the suface but with a huge impact.

It _might_ a bug for filter-branch to export GIT_DIR; sh-setup
deliberately chooses _not_ to export it.  I haven't really
thought through the issues, though...

^ permalink raw reply

* Re: How to remove invalid remote repository
From: Linus Torvalds @ 2007-06-05 20:18 UTC (permalink / raw)
  To: Matt Seitz; +Cc: git
In-Reply-To: <8A00BB77B01133479F4A56D932A1132202906FD8@EX-401.mail.navisite.com>



On Tue, 5 Jun 2007, Matt Seitz wrote:
>
> I mistakenly entered the wrong directory name for "git remote add" (I
> entered the working tree directory name instead of the ".git" directory
> name). 

Now, that should be fine. You don't have to add the .git name, git will 
figure it out on its own.

> So "git fetch" fails with:
> 
> fatal: 'origin': unable to chdir or not a git archive
> fatal: The remote end hung up unexpectedly

Well, this is because you apparently didn't call the remote "origin", but 
something else. So when you do

	git fetch

without giving any remote name at all, git will *default* to using 
"origin" as a remote, but since no such remote name exists, it will try to 
use that remote as a pathname (which is admittedly a bit silly, but git 
doesn't know that), and so what happened was that it was trying to fetch 
from the git repository "origin", but no such git repository existed, and 
thus it says:

	fatal: 'origin': unable to chdir or not a git archive

In fact, the remote name you added seems to be "root-etc", juding from 
your config file (which I've recreated here by looking at your "git 
config -l" output - things like whitespace may be off):

	[core]
		repositoryformatversion=0
		filemode=true
		bare=false
		logallrefupdates=true

	[gui]
		geometry=811x591+781+0 107 172

	[remote "root-etc"]
		url=/root/git/etc
		fetch=+refs/heads/*:refs/remotes/root-etc/*

> So, I tried removing the remote tracking branches:
> 
> git branch -d -r root-etc/master
> 
> But that failed with:
> 
> error: remote branch 'root-etc/master' not found.

The easiest way to remove the remote is _literally_ by just editing the 
".git/config" file. It's not magic, and the syntax really is as trivial as 
it looks, and it's perfectly ok to just fire up an editor and fix it up. 

In this case, the easiest fix is to not delete that remote entry at all 
(it's a fine entry, afaik), but you have to tell git that your local 
"master" branch should track it.  You do that by just adding

	[branch "master"]
		remote = root-etc
		merge = refs/heads/master

which tells git that when you are on the "master" branch, and do a "git 
fetch", it should fetch from that "root-etc" remote (and if you doa 
"pull", which implies also merging, it should merge the 
"refs/heads/master" branch from that remote into your local master).

> So I then tried recreating the remote reference:
> 
> git remote add root-etc /root/git/etc/.git
>
> But that failed with:
> 
> remote root-etc already exists

Right. It already does, because you already have it, and your previous add 
already worked. The only issue is that since you didn't tell that your 
current branch should be hooked up with that particular remote, so git 
ended up using the default (which is called "origin", not "root-etc").

		Linus

^ permalink raw reply

* Re: How to remove invalid remote repository
From: Jan Hudec @ 2007-06-05 20:14 UTC (permalink / raw)
  To: Matt Seitz; +Cc: git
In-Reply-To: <8A00BB77B01133479F4A56D932A1132202906FD8@EX-401.mail.navisite.com>

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

On Tue, Jun 05, 2007 at 14:41:04 -0500, Matt Seitz wrote:
> I mistakenly entered the wrong directory name for "git remote add" (I
> entered the working tree directory name instead of the ".git" directory
> name). 

There does not seem to be any 'git remote remove'. So you'll do it by
changing the config. Either with git-config, or by editing .git/config (it
*IS* meant to be hand-edited).

> [...]
> So, how can I remove the incorrect remote repository reference and
> replace it with a correct one?
> 
> [root@demo5 etc]# git config -l
> [...]
> remote.root-etc.url=/root/git/etc
                      ^^^^^^^^^^^^^
This is the URL. You can simply fix it either with 
    git-config remote.root-etc.url /root/git/etc/.git
or by editing
.git/config

> remote.root-etc.fetch=+refs/heads/*:refs/remotes/root-etc/*

The section corresponding to these two entries in .git/config looks like:

[remote "root-etc"]
url = /root/git/etc
fetch = +refs/heads/*:refs/remotes/root-etc/*

You can tweak it to your heart's content. The documentation is in man pages
of git-config and git-fetch.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] Add the --numbered-files option to git-format-patch.
From: Jon Loeliger @ 2007-06-05 20:06 UTC (permalink / raw)
  To: Git List

With this option, git-format-patch will generate simple
numbered files as output instead of the default using
with the first commit line appended.

This simplifies the ability to generate an MH-style
drafts folder with each message to be sent.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
---

Most of this patch is indenting the "if (sol)"
clause by one level.  Maybe apply it and "diff -w"
to see if you believe the patch.

Amazingly, some old guys in the crowd still use MH.

Yep, I used the new option to set up sending this message!

And, yes, I debated a more generalized option like:

    --filenames=<fmt>

with <fmt> being generalized for interpolatable things,
but I don't know what other things would have been
interesting.  So I opted for KISS.

jdl


 Documentation/git-format-patch.txt |   14 ++++-
 builtin-log.c                      |   97 +++++++++++++++++++++---------------
 2 files changed, 67 insertions(+), 44 deletions(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index a33d157..363edb0 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -11,7 +11,8 @@ SYNOPSIS
 [verse]
 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--thread]
                    [--attach[=<boundary>] | --inline[=<boundary>]]
-                   [-s | --signoff] [<common diff options>] [--start-number <n>]
+                   [-s | --signoff] [<common diff options>]
+                   [--start-number <n>] [--numbered-files]
                    [--in-reply-to=Message-Id] [--suffix=.<sfx>]
                    [--ignore-if-in-upstream]
                    [--subject-prefix=Subject-Prefix]
@@ -30,9 +31,11 @@ gitlink:git-rev-parse[1].
 The output of this command is convenient for e-mail submission or
 for use with gitlink:git-am[1].
 
-Each output file is numbered sequentially from 1, and uses the
+By default, each output file is numbered sequentially from 1, and uses the
 first line of the commit message (massaged for pathname safety) as
-the filename. The names of the output files are printed to standard
+the filename. With the --numbered-files option, the output file names
+will only be numbers, without the first line of the commit appended.
+The names of the output files are printed to standard
 output, unless the --stdout option is specified.
 
 If -o is specified, output files are created in <dir>.  Otherwise
@@ -60,6 +63,11 @@ include::diff-options.txt[]
 --start-number <n>::
 	Start numbering the patches at <n> instead of 1.
 
+--numbered-files::
+	Output file names will be a simple number sequence
+	without the default first line of the commit appended.
+	Mutually exclusive with the --stdout option.
+
 -k|--keep-subject::
 	Do not strip/add '[PATCH]' from the first line of the
 	commit log message.
diff --git a/builtin-log.c b/builtin-log.c
index 3744712..212cdfc 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -298,7 +298,8 @@ static int git_format_config(const char *var, const char *value)
 static FILE *realstdout = NULL;
 static const char *output_directory = NULL;
 
-static int reopen_stdout(struct commit *commit, int nr, int keep_subject)
+static int reopen_stdout(struct commit *commit, int nr, int keep_subject,
+			 int numbered_files)
 {
 	char filename[PATH_MAX];
 	char *sol;
@@ -315,53 +316,61 @@ static int reopen_stdout(struct commit *commit, int nr, int keep_subject)
 			filename[len++] = '/';
 	}
 
-	sprintf(filename + len, "%04d", nr);
-	len = strlen(filename);
-
-	sol = strstr(commit->buffer, "\n\n");
-	if (sol) {
-		int j, space = 1;
-
-		sol += 2;
-		/* strip [PATCH] or [PATCH blabla] */
-		if (!keep_subject && !prefixcmp(sol, "[PATCH")) {
-			char *eos = strchr(sol + 6, ']');
-			if (eos) {
-				while (isspace(*eos))
-					eos++;
-				sol = eos;
-			}
-		}
+	if (numbered_files) {
+		sprintf(filename + len, "%d", nr);
+		len = strlen(filename);
 
-		for (j = 0;
-		     j < FORMAT_PATCH_NAME_MAX - suffix_len - 5 &&
-			     len < sizeof(filename) - suffix_len &&
-			     sol[j] && sol[j] != '\n';
-		     j++) {
-			if (istitlechar(sol[j])) {
-				if (space) {
-					filename[len++] = '-';
-					space = 0;
+	} else {
+		sprintf(filename + len, "%04d", nr);
+		len = strlen(filename);
+
+		sol = strstr(commit->buffer, "\n\n");
+		if (sol) {
+			int j, space = 1;
+
+			sol += 2;
+			/* strip [PATCH] or [PATCH blabla] */
+			if (!keep_subject && !prefixcmp(sol, "[PATCH")) {
+				char *eos = strchr(sol + 6, ']');
+				if (eos) {
+					while (isspace(*eos))
+						eos++;
+					sol = eos;
 				}
-				filename[len++] = sol[j];
-				if (sol[j] == '.')
-					while (sol[j + 1] == '.')
-						j++;
-			} else
-				space = 1;
+			}
+
+			for (j = 0;
+			     j < FORMAT_PATCH_NAME_MAX - suffix_len - 5 &&
+				     len < sizeof(filename) - suffix_len &&
+				     sol[j] && sol[j] != '\n';
+			     j++) {
+				if (istitlechar(sol[j])) {
+					if (space) {
+						filename[len++] = '-';
+						space = 0;
+					}
+					filename[len++] = sol[j];
+					if (sol[j] == '.')
+						while (sol[j + 1] == '.')
+							j++;
+				} else
+					space = 1;
+			}
+			while (filename[len - 1] == '.'
+			       || filename[len - 1] == '-')
+				len--;
+			filename[len] = 0;
 		}
-		while (filename[len - 1] == '.' || filename[len - 1] == '-')
-			len--;
-		filename[len] = 0;
+		if (len + suffix_len >= sizeof(filename))
+			return error("Patch pathname too long");
+		strcpy(filename + len, fmt_patch_suffix);
 	}
-	if (len + suffix_len >= sizeof(filename))
-		return error("Patch pathname too long");
-	strcpy(filename + len, fmt_patch_suffix);
+
 	fprintf(realstdout, "%s\n", filename);
 	if (freopen(filename, "w", stdout) == NULL)
 		return error("Cannot open patch file %s",filename);
-	return 0;
 
+	return 0;
 }
 
 static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const char *prefix)
@@ -431,6 +440,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	int numbered = 0;
 	int start_number = -1;
 	int keep_subject = 0;
+	int numbered_files = 0;		/* _just_ numbers */
 	int subject_prefix = 0;
 	int ignore_if_in_upstream = 0;
 	int thread = 0;
@@ -465,6 +475,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			numbered = 1;
 		else if (!prefixcmp(argv[i], "--start-number="))
 			start_number = strtol(argv[i] + 15, NULL, 10);
+		else if (!strcmp(argv[i], "--numbered-files"))
+			numbered_files = 1;
 		else if (!strcmp(argv[i], "--start-number")) {
 			i++;
 			if (i == argc)
@@ -540,6 +552,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		die ("-n and -k are mutually exclusive.");
 	if (keep_subject && subject_prefix)
 		die ("--subject-prefix and -k are mutually exclusive.");
+	if (numbered_files && use_stdout)
+		die ("--numbered-files and --stdout are mutually exclusive.");
 
 	argc = setup_revisions(argc, argv, &rev, "HEAD");
 	if (argc > 1)
@@ -614,7 +628,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			rev.message_id = message_id;
 		}
 		if (!use_stdout)
-			if (reopen_stdout(commit, rev.nr, keep_subject))
+			if (reopen_stdout(commit, rev.nr, keep_subject,
+					  numbered_files))
 				die("Failed to create output files");
 		shown = log_tree_commit(&rev, commit);
 		free(commit->buffer);
-- 
1.5.2.1.116.g9f308-dirty

^ permalink raw reply related

* How to remove invalid remote repository
From: Matt Seitz @ 2007-06-05 19:41 UTC (permalink / raw)
  To: git

I mistakenly entered the wrong directory name for "git remote add" (I
entered the working tree directory name instead of the ".git" directory
name). 

So "git fetch" fails with:

fatal: 'origin': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

Cannot get the repository state from origin

So, I tried removing the remote tracking branches:

git branch -d -r root-etc/master

But that failed with:

error: remote branch 'root-etc/master' not found.


So I then tried recreating the remote reference:

git remote add root-etc /root/git/etc/.git
But that failed with:

remote root-etc already exists

So, how can I remove the incorrect remote repository reference and
replace it with a correct one?

[root@demo5 etc]# git config -l
core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

gui.geometry=811x591+781+0 107 172

remote.root-etc.url=/root/git/etc

remote.root-etc.fetch=+refs/heads/*:refs/remotes/root-etc/*

[root@demo5 etc]# git version

git version 1.5.0.7

^ permalink raw reply

* Re: [PATCH 1/2] Show html help with git-help --html
From: Nguyen Thai Ngoc Duy @ 2007-06-05 19:42 UTC (permalink / raw)
  To: Frank Lichtenheld; +Cc: git, junkio
In-Reply-To: <20070605193451.GG17377@planck.djpig.de>

On 6/5/07, Frank Lichtenheld <frank@lichtenheld.de> wrote:
> On Tue, Jun 05, 2007 at 06:34:20PM +0000, Nguyen Thai Ngoc Duy wrote:
> > +core.help::
> > +     If 'html', it is equivalent to 'git-help' with option --html.
> > +     If 'auto', it tries to open html files first. If that attempt fails
> > +     (the html program does not exist or the program return non-zero
> > +     value), then it will fall back to man pages. If 'man', always use
> > +     man pages as usual.
>
> This should mention the default value. (Which is 'man', if I read the
> code correctly, isn't it?)

Ok.

>
> > +core.htmlprogram::
> > +     Specify the program used to open html help files when 'git-help'
> > +     is called with option --html or core.help is other than 'man'.
> > +     By default, xdg-open will be used.
> > +     Special strings '%p', '%f' and '%b' will be replaced with html
> > +     full path, file name and git command (without .html suffix)
> > +     respectively. If none is given, '%p' will be automatically appended
> > +     to the command line.
>
> htmlprogram sounds kludgy to me. I would've used htmlcommand or perhaps
> htmlviewer. But I'm no native English speaker, so I might be entirely
> wrong about that.

Will vote for any better name than htmlprogram as I see it awkward too :)
htmlviewer seems better (or htmlviewercommand, which is too long).
Anyway I'm not a native English speaker either.

>
> Gruesse,
> --
> Frank Lichtenheld <frank@lichtenheld.de>
> www: http://www.djpig.de/
>


-- 
Duy

^ permalink raw reply

* Re: [PATCH 1/2] Show html help with git-help --html
From: Frank Lichtenheld @ 2007-06-05 19:34 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git, junkio
In-Reply-To: <20070605183420.GA8450@localhost>

On Tue, Jun 05, 2007 at 06:34:20PM +0000, Nguyen Thai Ngoc Duy wrote:
> +core.help::
> +	If 'html', it is equivalent to 'git-help' with option --html.
> +	If 'auto', it tries to open html files first. If that attempt fails
> +	(the html program does not exist or the program return non-zero
> +	value), then it will fall back to man pages. If 'man', always use
> +	man pages as usual.

This should mention the default value. (Which is 'man', if I read the
code correctly, isn't it?)

> +core.htmlprogram::
> +	Specify the program used to open html help files when 'git-help'
> +	is called with option --html or core.help is other than 'man'.
> +	By default, xdg-open will be used.
> +	Special strings '%p', '%f' and '%b' will be replaced with html
> +	full path, file name and git command (without .html suffix)
> +	respectively. If none is given, '%p' will be automatically appended
> +	to the command line.

htmlprogram sounds kludgy to me. I would've used htmlcommand or perhaps
htmlviewer. But I'm no native English speaker, so I might be entirely
wrong about that.

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

^ permalink raw reply

* Re: [PATCH] filter-branch: use sh -c instead of eval
From: Johannes Sixt @ 2007-06-05 19:02 UTC (permalink / raw)
  To: git
In-Reply-To: <20070605165734.GA21708@moooo.ath.cx>

Matthias Lederhofer wrote:

> If filters use variables with the same name as variables
> used in the script the script breaks.  Executing the filters
> in a separate process prevents accidential modification of
> the variables in the main process.
> @@ -349,21 +349,21 @@ while read commit; do
>  
>  eval "$(set_ident AUTHOR <../commit)"
>  eval "$(set_ident COMMITTER <../commit)"
> -     eval "$filter_env" < /dev/null
> +     sh -c "$filter_env" < /dev/null

NACK.

The eval is on purpose here. $filter_env must be able export GIT_AUTHOR* and
GIT_COMMITTER* variables here.

Generally, it might be useful that one filter sets or exports variables that
are then available for subsequent filters or the next commit. Therefore, I
think it's actually a feature to have eval instead of sh -c even if there
is a chance that the filter overwrites internal variables. 

-- Hannes

^ permalink raw reply

* Re: [ANNOUNCE] qgit new "smart browsing" feature
From: Marco Costalba @ 2007-06-05 18:48 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git, Pavel Roskin, Jan Hudec
In-Reply-To: <200706042004.01819.andyparkins@gmail.com>

On 6/4/07, Andy Parkins <andyparkins@gmail.com> wrote:
> On Monday 2007, June 04, Marco Costalba wrote:
>
> >   I have to say that I really like your idea!
>
> Hurrah!  See - even a blind golfer knocks one in eventually :-)
>
> > Probably I will create a new branch called andy_gui where I'll
> > implement your idea, while continue to refine the current approach.
>
> Great stuff.  If I get a moment, I'll try and chip in with some patches.
>

Hi Andy,

  feel free to go wild.


I've just pushed a patch series that implements your tab widget idea.

I've found that, luckily, the required change is small, so small that
I didn't create a new development branch but just a couple of check
boxes in 'Edit->Settings-Browse' dialog from where you can
enable/disable all these new fancy toys and play with them.

Have fun and let me know!

Marco

^ permalink raw reply

* [PATCH 1/2] Show html help with git-help --html
From: Nguyen Thai Ngoc Duy @ 2007-06-05 18:34 UTC (permalink / raw)
  To: git; +Cc: junkio

This patch was inspired by ClearCase command 'ct man', which
opens an html help file on Windows. I at first attempted to
implement it for MinGW port only but found it so useful that I
wanted to have it even in Linux.

A new option '--html' is added to git. When git-help is called
with --html, it will try to open an html file located at
$(docdir)/html using xdg-open. HTML files are not installed
by default so users have to install them manually or have their
distributors to do that.

There are two new config options introduced in this patch. The
first is core.help. It has one of three values: html, auto or
man. 'html' has the same effect as git-help --html. 'auto'
will in addition fall back to man pages if possible. 'man'
is 'I hate html, give me my man pages'.  The second option is
core.htmlprogram, used to specify the program you want to
open html files instead of xdg-open. You can override the default
program by appending HTML_PROGRAM=blah when calling make.
core.htmlprogram can contain %p, %f or %b.  If none is given,
%p will be appended.

Signed-off-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
---

Sorry the previous patch had broken commit message.

 Documentation/config.txt |   16 +++++
 Documentation/git.txt    |    5 +-
 Makefile                 |    5 +-
 cache.h                  |    2 +
 config.c                 |   17 +++++
 config.mak.in            |    3 +-
 environment.c            |    2 +
 git.c                    |    2 +-
 help.c                   |  166 +++++++++++++++++++++++++++++++++++++++++++++-
 9 files changed, 212 insertions(+), 6 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d58..7687750 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -262,6 +262,22 @@ core.excludeFile::
 	of files which are not meant to be tracked.  See
 	gitlink:gitignore[5].
 
+core.help::
+	If 'html', it is equivalent to 'git-help' with option --html.
+	If 'auto', it tries to open html files first. If that attempt fails
+	(the html program does not exist or the program return non-zero
+	value), then it will fall back to man pages. If 'man', always use
+	man pages as usual.
+
+core.htmlprogram::
+	Specify the program used to open html help files when 'git-help'
+	is called with option --html or core.help is other than 'man'.
+	By default, xdg-open will be used.
+	Special strings '%p', '%f' and '%b' will be replaced with html
+	full path, file name and git command (without .html suffix)
+	respectively. If none is given, '%p' will be automatically appended
+	to the command line.
+
 alias.*::
 	Command aliases for the gitlink:git[1] command wrapper - e.g.
 	after defining "alias.last = cat-file commit HEAD", the invocation
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 98860af..589ebea 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]
-    [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
+    [--bare] [--git-dir=GIT_DIR] [--help [--html]] COMMAND [ARGS]
 
 DESCRIPTION
 -----------
@@ -87,6 +87,9 @@ OPTIONS
 	commands.  If a git command is named this option will bring up
 	the man-page for that command. If the option '--all' or '-a' is
 	given then all available commands are printed.
+	If option '--html' is given, try opening html files instead of
+	using 'man'. The default program to open html files is xdg-open.
+	See 'git-config' to know how to change html program.
 
 --exec-path::
 	Path to wherever your core git programs are installed.
diff --git a/Makefile b/Makefile
index a11ff60..744a732 100644
--- a/Makefile
+++ b/Makefile
@@ -186,6 +186,7 @@ export TCL_PATH TCLTK_PATH
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
+HTML_PROGRAM=xdg-open
 
 
 ### --- END CONFIGURATION SECTION ---
@@ -693,6 +694,7 @@ ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
+html_dir_SQ = $(subst ','\'',$(html_dir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
 prefix_SQ = $(subst ','\'',$(prefix))
 
@@ -741,7 +743,8 @@ git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS
 		$(ALL_CFLAGS) -o $@ $(filter %.c,$^) \
 		$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
 
-help.o: common-cmds.h
+help.o: help.c common-cmds.h
+	$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DHTML_DIR='"$(html_dir_SQ)"' -DHTML_PROGRAM='"$(HTML_PROGRAM)"' $<
 
 git-merge-subtree$X: git-merge-recursive$X
 	$(QUIET_BUILT_IN)rm -f $@ && ln git-merge-recursive$X $@
diff --git a/cache.h b/cache.h
index 8a9d1f3..dbaae6a 100644
--- a/cache.h
+++ b/cache.h
@@ -288,6 +288,8 @@ extern size_t packed_git_window_size;
 extern size_t packed_git_limit;
 extern size_t delta_base_cache_limit;
 extern int auto_crlf;
+extern int show_html_help;
+extern const char *html_help_program;
 
 #define GIT_REPO_VERSION 0
 extern int repository_format_version;
diff --git a/config.c b/config.c
index 0614c2b..d216ab7 100644
--- a/config.c
+++ b/config.c
@@ -382,6 +382,23 @@ int git_default_config(const char *var, const char *value)
 		return 0;
 	}
 
+	if (!strcmp(var, "core.help")) {
+		if (!strcmp(value, "auto"))
+			show_html_help = 2;
+		else if (!strcmp(value, "html"))
+			show_html_help = 1;
+		else if (!strcmp(value, "man"))
+			show_html_help = 0;
+		else
+			return 1;
+		return 0;
+	}
+
+	if (!strcmp(var, "core.htmlprogram")) {
+		html_help_program = xstrdup(value);
+		return 0;
+	}
+
 	/* Add other config variables here and to Documentation/config.txt. */
 	return 0;
 }
diff --git a/config.mak.in b/config.mak.in
index eb9d7a5..c3e410d 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -8,12 +8,14 @@ TAR = @TAR@
 #INSTALL = @INSTALL@		# needs install-sh or install.sh in sources
 TCLTK_PATH = @TCLTK_PATH@
 
+PACKAGE_TARNAME=@PACKAGE_TARNAME@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
 #gitexecdir = @libexecdir@/git-core/
 datarootdir = @datarootdir@
 template_dir = @datadir@/git-core/templates/
+html_dir = @docdir@/html/
 
 mandir=@mandir@
 
@@ -38,4 +40,3 @@ NO_STRCASESTR=@NO_STRCASESTR@
 NO_STRLCPY=@NO_STRLCPY@
 NO_SETENV=@NO_SETENV@
 NO_ICONV=@NO_ICONV@
-
diff --git a/environment.c b/environment.c
index 9d3e5eb..e905972 100644
--- a/environment.c
+++ b/environment.c
@@ -32,6 +32,8 @@ size_t delta_base_cache_limit = 16 * 1024 * 1024;
 int pager_in_use;
 int pager_use_color = 1;
 int auto_crlf = 0;	/* 1: both ways, -1: only when adding git objects */
+int show_html_help = 0;
+const char *html_help_program = NULL;
 
 static const char *git_dir;
 static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;
diff --git a/git.c b/git.c
index 29b55a1..c3c0fe8 100644
--- a/git.c
+++ b/git.c
@@ -4,7 +4,7 @@
 #include "quote.h"
 
 const char git_usage_string[] =
-	"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]";
+	"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help [--html]] COMMAND [ARGS]";
 
 static void prepend_to_path(const char *dir, int len)
 {
diff --git a/help.c b/help.c
index 6a9af4d..78b1023 100644
--- a/help.c
+++ b/help.c
@@ -9,6 +9,14 @@
 #include "common-cmds.h"
 #include <sys/ioctl.h>
 
+#ifndef HTML_DIR
+#define HTML_DIR "/usr/share/html/"
+#endif
+
+#ifndef HTML_PROGRAM
+#define HTML_PROGRAM "xdg-open"
+#endif
+
 /* most GUI terminals set COLUMNS (although some don't export it) */
 static int term_columns(void)
 {
@@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd)
 	execlp("man", "man", page, NULL);
 }
 
+static void show_html_page(const char *git_cmd)
+{
+	const char *html_dir;
+	int len, ret, nr_quotes;
+	char *p, *p2;
+	const char *cp, *cp2;
+	struct stat st;
+	char *quoted_git_cmd;
+	char *default_command = NULL;
+	const char *command;
+
+	html_dir = HTML_DIR;
+	command = html_help_program ? html_help_program : HTML_PROGRAM;
+
+	nr_quotes = 0;
+	for (cp = git_cmd; *cp; cp++)
+		if (*cp == '\'') nr_quotes ++;
+
+	len = strlen(git_cmd) + nr_quotes*2 + 2 + 4; /* two quotes and git- */
+	quoted_git_cmd = p2 = xmalloc(len + 1);
+	*p2++ = '\'';
+	if (prefixcmp(git_cmd, "git")) {
+		strcpy(p2,"git-");
+		p2 += 4;
+	}
+	for (cp = git_cmd; *cp; cp ++) {
+		if (*cp == '\'')
+			*p2++ = '\\';
+		*p2++ = *cp;
+	}
+	*p2++ = '\'';
+	*p2 = 0;
+
+	/* append %p if there is not any %x */
+	if (!strchr(command, '%')) {
+		len = strlen(command);
+		default_command = xmalloc(len + 3 + 1); /* space %p */
+		strcpy(default_command, command);
+		strcat(default_command, " %p");
+		command = default_command;
+	}
+
+	/* first pass, calculate command length */
+	cp = command;
+	len = 0;
+	while (*cp && (cp2 = strchr(cp, '%'))) {
+		len += cp2 - cp;
+
+		if (!cp2[1]) {
+			len ++;
+			break;
+		}
+
+		switch (cp2[1]) {
+			case 'p':
+				len += strlen(html_dir) + strlen(quoted_git_cmd) + 5; /* .html */
+				break;
+
+			case 'f':
+				len += strlen(quoted_git_cmd) + 5; /* .html */
+				break;
+
+			case 'b':
+				len += strlen(quoted_git_cmd);
+				break;
+
+			default:
+				len += 2;
+		}
+		cp = cp2 + 2;
+	}
+
+	/* second pass */
+	cp = command;
+	p = p2 = xmalloc(len + 1);
+	while (*cp && (cp2 = strchr(cp, '%'))) {
+		len = cp2 - cp;
+		memcpy(p2, cp, len);
+		p2 += len;
+
+		if (!cp2[1]) {
+			*p2++ = *cp2;
+			break;
+		}
+
+		switch (cp2[1]) {
+			case 'p':
+				len = strlen(html_dir);
+				memcpy(p2, html_dir, len);
+				p2 += len;
+
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+
+				memcpy(p2, ".html", 5);
+				p2 += 5;
+				break;
+
+			case 'f':
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+
+				memcpy(p2, ".html", 5);
+				p2 += 5;
+				break;
+
+			case 'b':
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+				break;
+
+			default:
+				*p2++ = cp2[0];
+				*p2++ = cp2[1];
+		}
+		cp = cp2+2;
+	}
+	*p2 = 0;
+
+	free(quoted_git_cmd);
+	if (default_command)
+		free(default_command);
+
+	ret = system(p);
+
+	if (ret == -1)
+		error("Failed to run %s", p);
+
+	free(p);
+
+	/* fallback to man pages */
+	if (show_html_help > 1 && (ret == -1 || ret > 0))
+		show_man_page(git_cmd);
+	exit(ret);
+}
+
 void help_unknown_cmd(const char *cmd)
 {
 	printf("git: '%s' is not a git-command\n\n", cmd);
@@ -214,8 +361,23 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 		exit(1);
 	}
 
-	else
-		show_man_page(help_cmd);
+	else {
+		git_config(git_default_config);
+		if (!strcmp(help_cmd, "--html")) {
+			help_cmd = argc > 2 ? argv[2] : NULL;
+			if (!help_cmd) {
+				printf("usage: %s\n\n", git_usage_string);
+				list_common_cmds_help();
+				exit(1);
+			}
+			show_html_help = 1;
+		}
+
+		if (show_html_help)
+			show_html_page(help_cmd);
+		else
+			show_man_page(help_cmd);
+	}
 
 	return 0;
 }
-- 
1.5.0.7

^ permalink raw reply related

* [PATCH 2/2] Add rule install-html to install html files to $(html_dir)
From: Nguyen Thai Ngoc Duy @ 2007-06-05 18:29 UTC (permalink / raw)
  To: git; +Cc: junkio


Signed-off-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
---

Now you can make install; make -C Documentation install-html
and enjoy git-help --html


 Documentation/Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9cef480..7a5e5d3 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -71,6 +71,9 @@ install: man
 	$(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
 	$(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
 
+install-html: html
+	$(INSTALL) -d -m755 $(DESTDIR)$(html_dir)
+	$(INSTALL) -m644 *.html $(DESTDIR)$(html_dir)
 
 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	$(MAKE) -C ../ GIT-VERSION-FILE
-- 
1.5.0.7

^ permalink raw reply related

* [PATCH 1/2] This patch was inspired by ClearCase command 'ct man', which
From: Nguyen Thai Ngoc Duy @ 2007-06-05 18:28 UTC (permalink / raw)
  To: git; +Cc: junkio

opens an html help file on Windows. I at first attempted to
implement it for MinGW port only but found it so useful that I
wanted to have it even in Linux.

A new option '--html' is added to git. When git-help is called
with --html, it will try to open an html file located at
$(docdir)/html using xdg-open. HTML files are not installed
by default so users have to install them manually or have their
distributors to do that.

There are two new config options introduced in this patch. The
first is core.help. It has one of three values: html, auto or
man. 'html' has the same effect as git-help --html. 'auto'
will in addition fall back to man pages if possible. 'man'
is 'I hate html, give me my man pages'.  The second option is
core.htmlprogram, used to specify the program you want to
open html files instead of xdg-open. You can override the default
program by appending HTML_PROGRAM=blah when calling make.
core.htmlprogram can contain %p, %f or %b.  If none is given,
%p will be appended.

Signed-off-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
---
 Documentation/config.txt |   16 +++++
 Documentation/git.txt    |    5 +-
 Makefile                 |    5 +-
 cache.h                  |    2 +
 config.c                 |   17 +++++
 config.mak.in            |    3 +-
 environment.c            |    2 +
 git.c                    |    2 +-
 help.c                   |  166 +++++++++++++++++++++++++++++++++++++++++++++-
 9 files changed, 212 insertions(+), 6 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d58..7687750 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -262,6 +262,22 @@ core.excludeFile::
 	of files which are not meant to be tracked.  See
 	gitlink:gitignore[5].
 
+core.help::
+	If 'html', it is equivalent to 'git-help' with option --html.
+	If 'auto', it tries to open html files first. If that attempt fails
+	(the html program does not exist or the program return non-zero
+	value), then it will fall back to man pages. If 'man', always use
+	man pages as usual.
+
+core.htmlprogram::
+	Specify the program used to open html help files when 'git-help'
+	is called with option --html or core.help is other than 'man'.
+	By default, xdg-open will be used.
+	Special strings '%p', '%f' and '%b' will be replaced with html
+	full path, file name and git command (without .html suffix)
+	respectively. If none is given, '%p' will be automatically appended
+	to the command line.
+
 alias.*::
 	Command aliases for the gitlink:git[1] command wrapper - e.g.
 	after defining "alias.last = cat-file commit HEAD", the invocation
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 98860af..589ebea 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]
-    [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
+    [--bare] [--git-dir=GIT_DIR] [--help [--html]] COMMAND [ARGS]
 
 DESCRIPTION
 -----------
@@ -87,6 +87,9 @@ OPTIONS
 	commands.  If a git command is named this option will bring up
 	the man-page for that command. If the option '--all' or '-a' is
 	given then all available commands are printed.
+	If option '--html' is given, try opening html files instead of
+	using 'man'. The default program to open html files is xdg-open.
+	See 'git-config' to know how to change html program.
 
 --exec-path::
 	Path to wherever your core git programs are installed.
diff --git a/Makefile b/Makefile
index a11ff60..744a732 100644
--- a/Makefile
+++ b/Makefile
@@ -186,6 +186,7 @@ export TCL_PATH TCLTK_PATH
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
+HTML_PROGRAM=xdg-open
 
 
 ### --- END CONFIGURATION SECTION ---
@@ -693,6 +694,7 @@ ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
+html_dir_SQ = $(subst ','\'',$(html_dir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
 prefix_SQ = $(subst ','\'',$(prefix))
 
@@ -741,7 +743,8 @@ git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS
 		$(ALL_CFLAGS) -o $@ $(filter %.c,$^) \
 		$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
 
-help.o: common-cmds.h
+help.o: help.c common-cmds.h
+	$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DHTML_DIR='"$(html_dir_SQ)"' -DHTML_PROGRAM='"$(HTML_PROGRAM)"' $<
 
 git-merge-subtree$X: git-merge-recursive$X
 	$(QUIET_BUILT_IN)rm -f $@ && ln git-merge-recursive$X $@
diff --git a/cache.h b/cache.h
index 8a9d1f3..dbaae6a 100644
--- a/cache.h
+++ b/cache.h
@@ -288,6 +288,8 @@ extern size_t packed_git_window_size;
 extern size_t packed_git_limit;
 extern size_t delta_base_cache_limit;
 extern int auto_crlf;
+extern int show_html_help;
+extern const char *html_help_program;
 
 #define GIT_REPO_VERSION 0
 extern int repository_format_version;
diff --git a/config.c b/config.c
index 0614c2b..d216ab7 100644
--- a/config.c
+++ b/config.c
@@ -382,6 +382,23 @@ int git_default_config(const char *var, const char *value)
 		return 0;
 	}
 
+	if (!strcmp(var, "core.help")) {
+		if (!strcmp(value, "auto"))
+			show_html_help = 2;
+		else if (!strcmp(value, "html"))
+			show_html_help = 1;
+		else if (!strcmp(value, "man"))
+			show_html_help = 0;
+		else
+			return 1;
+		return 0;
+	}
+
+	if (!strcmp(var, "core.htmlprogram")) {
+		html_help_program = xstrdup(value);
+		return 0;
+	}
+
 	/* Add other config variables here and to Documentation/config.txt. */
 	return 0;
 }
diff --git a/config.mak.in b/config.mak.in
index eb9d7a5..c3e410d 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -8,12 +8,14 @@ TAR = @TAR@
 #INSTALL = @INSTALL@		# needs install-sh or install.sh in sources
 TCLTK_PATH = @TCLTK_PATH@
 
+PACKAGE_TARNAME=@PACKAGE_TARNAME@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
 #gitexecdir = @libexecdir@/git-core/
 datarootdir = @datarootdir@
 template_dir = @datadir@/git-core/templates/
+html_dir = @docdir@/html/
 
 mandir=@mandir@
 
@@ -38,4 +40,3 @@ NO_STRCASESTR=@NO_STRCASESTR@
 NO_STRLCPY=@NO_STRLCPY@
 NO_SETENV=@NO_SETENV@
 NO_ICONV=@NO_ICONV@
-
diff --git a/environment.c b/environment.c
index 9d3e5eb..e905972 100644
--- a/environment.c
+++ b/environment.c
@@ -32,6 +32,8 @@ size_t delta_base_cache_limit = 16 * 1024 * 1024;
 int pager_in_use;
 int pager_use_color = 1;
 int auto_crlf = 0;	/* 1: both ways, -1: only when adding git objects */
+int show_html_help = 0;
+const char *html_help_program = NULL;
 
 static const char *git_dir;
 static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;
diff --git a/git.c b/git.c
index 29b55a1..c3c0fe8 100644
--- a/git.c
+++ b/git.c
@@ -4,7 +4,7 @@
 #include "quote.h"
 
 const char git_usage_string[] =
-	"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]";
+	"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--help [--html]] COMMAND [ARGS]";
 
 static void prepend_to_path(const char *dir, int len)
 {
diff --git a/help.c b/help.c
index 6a9af4d..78b1023 100644
--- a/help.c
+++ b/help.c
@@ -9,6 +9,14 @@
 #include "common-cmds.h"
 #include <sys/ioctl.h>
 
+#ifndef HTML_DIR
+#define HTML_DIR "/usr/share/html/"
+#endif
+
+#ifndef HTML_PROGRAM
+#define HTML_PROGRAM "xdg-open"
+#endif
+
 /* most GUI terminals set COLUMNS (although some don't export it) */
 static int term_columns(void)
 {
@@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd)
 	execlp("man", "man", page, NULL);
 }
 
+static void show_html_page(const char *git_cmd)
+{
+	const char *html_dir;
+	int len, ret, nr_quotes;
+	char *p, *p2;
+	const char *cp, *cp2;
+	struct stat st;
+	char *quoted_git_cmd;
+	char *default_command = NULL;
+	const char *command;
+
+	html_dir = HTML_DIR;
+	command = html_help_program ? html_help_program : HTML_PROGRAM;
+
+	nr_quotes = 0;
+	for (cp = git_cmd; *cp; cp++)
+		if (*cp == '\'') nr_quotes ++;
+
+	len = strlen(git_cmd) + nr_quotes*2 + 2 + 4; /* two quotes and git- */
+	quoted_git_cmd = p2 = xmalloc(len + 1);
+	*p2++ = '\'';
+	if (prefixcmp(git_cmd, "git")) {
+		strcpy(p2,"git-");
+		p2 += 4;
+	}
+	for (cp = git_cmd; *cp; cp ++) {
+		if (*cp == '\'')
+			*p2++ = '\\';
+		*p2++ = *cp;
+	}
+	*p2++ = '\'';
+	*p2 = 0;
+
+	/* append %p if there is not any %x */
+	if (!strchr(command, '%')) {
+		len = strlen(command);
+		default_command = xmalloc(len + 3 + 1); /* space %p */
+		strcpy(default_command, command);
+		strcat(default_command, " %p");
+		command = default_command;
+	}
+
+	/* first pass, calculate command length */
+	cp = command;
+	len = 0;
+	while (*cp && (cp2 = strchr(cp, '%'))) {
+		len += cp2 - cp;
+
+		if (!cp2[1]) {
+			len ++;
+			break;
+		}
+
+		switch (cp2[1]) {
+			case 'p':
+				len += strlen(html_dir) + strlen(quoted_git_cmd) + 5; /* .html */
+				break;
+
+			case 'f':
+				len += strlen(quoted_git_cmd) + 5; /* .html */
+				break;
+
+			case 'b':
+				len += strlen(quoted_git_cmd);
+				break;
+
+			default:
+				len += 2;
+		}
+		cp = cp2 + 2;
+	}
+
+	/* second pass */
+	cp = command;
+	p = p2 = xmalloc(len + 1);
+	while (*cp && (cp2 = strchr(cp, '%'))) {
+		len = cp2 - cp;
+		memcpy(p2, cp, len);
+		p2 += len;
+
+		if (!cp2[1]) {
+			*p2++ = *cp2;
+			break;
+		}
+
+		switch (cp2[1]) {
+			case 'p':
+				len = strlen(html_dir);
+				memcpy(p2, html_dir, len);
+				p2 += len;
+
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+
+				memcpy(p2, ".html", 5);
+				p2 += 5;
+				break;
+
+			case 'f':
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+
+				memcpy(p2, ".html", 5);
+				p2 += 5;
+				break;
+
+			case 'b':
+				len = strlen(quoted_git_cmd);
+				memcpy(p2, quoted_git_cmd, len);
+				p2 += len;
+				break;
+
+			default:
+				*p2++ = cp2[0];
+				*p2++ = cp2[1];
+		}
+		cp = cp2+2;
+	}
+	*p2 = 0;
+
+	free(quoted_git_cmd);
+	if (default_command)
+		free(default_command);
+
+	ret = system(p);
+
+	if (ret == -1)
+		error("Failed to run %s", p);
+
+	free(p);
+
+	/* fallback to man pages */
+	if (show_html_help > 1 && (ret == -1 || ret > 0))
+		show_man_page(git_cmd);
+	exit(ret);
+}
+
 void help_unknown_cmd(const char *cmd)
 {
 	printf("git: '%s' is not a git-command\n\n", cmd);
@@ -214,8 +361,23 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 		exit(1);
 	}
 
-	else
-		show_man_page(help_cmd);
+	else {
+		git_config(git_default_config);
+		if (!strcmp(help_cmd, "--html")) {
+			help_cmd = argc > 2 ? argv[2] : NULL;
+			if (!help_cmd) {
+				printf("usage: %s\n\n", git_usage_string);
+				list_common_cmds_help();
+				exit(1);
+			}
+			show_html_help = 1;
+		}
+
+		if (show_html_help)
+			show_html_page(help_cmd);
+		else
+			show_man_page(help_cmd);
+	}
 
 	return 0;
 }
-- 
1.5.0.7

^ permalink raw reply related

* nevermind Re: [PATCH] +test-sha1 to .gitignore
From: Randal L. Schwartz @ 2007-06-05 17:29 UTC (permalink / raw)
  To: git
In-Reply-To: <86ejkqpb60.fsf@blue.stonehenge.com>


My process aborts the pull if I'm not on master, so I didn't see
that it had already been incorporated.

*Someday*, I'm going to learn to play well with others. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply

* Re: [PATCH] filter-branch: always export GIT_DIR if it is set
From: Johannes Schindelin @ 2007-06-05 17:27 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: Junio C Hamano, git
In-Reply-To: <20070605164957.GA12358@moooo.ath.cx>

Hi,

On Tue, 5 Jun 2007, Matthias Lederhofer wrote:

> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index 0c8a7df..f4cfbea 100644
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -313,9 +313,12 @@ workdir="$(pwd)"
>  
>  case "$GIT_DIR" in
>  /*)
> +	export GIT_DIR
> +	export GIT_WORK_TREE=.
>  	;;

Doesn't it strike somebody else as intrusive, if GIT_WORK_TREE has to 
touch that many places?

IMHO there should be a less intrusive, and possibly simpler, way to do it. 
I am not at all interested in that feature, and I don't want to suffer 
bugs from it either.

Ciao,
Dscho

^ permalink raw reply


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