* Re: push problem for new repo on repo.or.cz
From: Petr Baudis @ 2009-03-09 16:51 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Git Mailing List
In-Reply-To: <49B53DAF.9080004@drmicha.warpmail.net>
Hello,
On Mon, Mar 09, 2009 at 05:02:55PM +0100, Michael J Gruber wrote:
> I have problems pushing into a new project on repo.or.cz. My user (mjg)
> is added in the admin interface, the key is correct because I've been
> using it for a while already for other projects (forks though). I'm
> using a qualified refspec. What else could be wrong on my side, assuming
> it's not the scripts on repo.or.cz? My git is 1.6.2.
your user has actually not been added in the admin interface, please
try again.
Best,
Petr "Pasky" Baudis
^ permalink raw reply
* Re: [PATCH 0/2] Move push logic to transport.c
From: Daniel Barkalow @ 2009-03-09 16:57 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0903091711180.6358@intel-tinevez-2-302>
On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 9 Mar 2009, Daniel Barkalow wrote:
>
> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> >
> > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:
> > >
> > > > It doesn't convert http-push or the rsync transports, largely
> > > > because I don't have test setups for rsync or webdav to make sure
> > > > that they're still working.
> > >
> > > $ ls t/*http-push*
> > > t/t5540-http-push.sh
> > >
> > > $ git grep -n test.*rsync t/
> > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '
> > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '
> > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '
> > >
> > > It should be just a matter of installing an apache and rsync.
> >
> > And configuring them suitably, yes. That's the part I haven't previously
> > done.
>
> If you have to configure apache (or rsync) for the test to run properly,
> we have a serious bug in our test suite. Please share the output in that
> case.
rsync: failed to connect to 127.0.0.1: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
fatal: Could not run rsync to get refs
I mean, I won't need to do anything really special in the configuration,
but I do need to have rsyncd running giving access to that directory
without any funny mapping on localhost.
The apache test does, in fact, run its own server, so that should be easy
enough (although I do need to install an apache with mod_dav.so, which I
don't have handy).
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: push problem for new repo on repo.or.cz
From: Johannes Schindelin @ 2009-03-09 16:59 UTC (permalink / raw)
To: Petr Baudis; +Cc: Michael J Gruber, Git Mailing List
In-Reply-To: <20090309165139.GV8940@machine.or.cz>
Hi,
On Mon, 9 Mar 2009, Petr Baudis wrote:
> On Mon, Mar 09, 2009 at 05:02:55PM +0100, Michael J Gruber wrote:
> > I have problems pushing into a new project on repo.or.cz. My user
> > (mjg) is added in the admin interface, the key is correct because I've
> > been using it for a while already for other projects (forks though).
> > I'm using a qualified refspec. What else could be wrong on my side,
> > assuming it's not the scripts on repo.or.cz? My git is 1.6.2.
>
> your user has actually not been added in the admin interface, please try
> again.
Indeed. I should have checked before giving a smart-ass answer ;-)
Note: when adding a user, you have to enter the admin password... Failing
that, you will see exactly the same form, but a red warning saying that
the user has not been added.
Ciao,
Dscho
^ permalink raw reply
* Massive spam attack on the GitWiki
From: Johannes Schindelin @ 2009-03-09 17:07 UTC (permalink / raw)
To: git, pasky
Hi,
there seems to be a spam attack on the GitWiki. Pasky, could you change
the settings so that attachments are disallowed? It is really
distressing. Especially since pages I delete crop up again because of
those spammers attaching new attachments.
Also, is it possible to remove/block users?
Ciao,
Dscho
^ permalink raw reply
* Re: push problem for new repo on repo.or.cz
From: Michael J Gruber @ 2009-03-09 17:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Petr Baudis, Git Mailing List
In-Reply-To: <alpine.DEB.1.00.0903091758390.6358@intel-tinevez-2-302>
Johannes Schindelin venit, vidit, dixit 09.03.2009 17:59:
> Hi,
>
> On Mon, 9 Mar 2009, Petr Baudis wrote:
>
>> On Mon, Mar 09, 2009 at 05:02:55PM +0100, Michael J Gruber wrote:
>>> I have problems pushing into a new project on repo.or.cz. My user
>>> (mjg) is added in the admin interface, the key is correct because I've
>>> been using it for a while already for other projects (forks though).
>>> I'm using a qualified refspec. What else could be wrong on my side,
>>> assuming it's not the scripts on repo.or.cz? My git is 1.6.2.
>> your user has actually not been added in the admin interface, please try
>> again.
>
> Indeed. I should have checked before giving a smart-ass answer ;-)
>
> Note: when adding a user, you have to enter the admin password... Failing
> that, you will see exactly the same form, but a red warning saying that
> the user has not been added.
Uhm, what I had done:
- added the user
- got back the same admin form /which now listed mjg as a user which had
been added/ (with a checkmark)
- after the push failed, went to the form again, hit update again, still
saw mjg listed as a user for the project.
So, there was no red warning, instead there was a confirmation.
OK, I went back now. mjg was not listed any more. Added it (again), now
things work, I'm happy, I shut up.
Well, what may have happened was that the red warning was displayed at
the top of the paage while the confirmation was listed at the bottom.
In any case, thanks for hosting!
Cheers,
Michael
^ permalink raw reply
* Re: [PATCH 0/2] Move push logic to transport.c
From: Johannes Schindelin @ 2009-03-09 17:11 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LNX.1.00.0903091230430.19665@iabervon.org>
Hi,
On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> On Mon, 9 Mar 2009, Johannes Schindelin wrote:
>
> > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> >
> > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > >
> > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:
> > > >
> > > > > It doesn't convert http-push or the rsync transports, largely
> > > > > because I don't have test setups for rsync or webdav to make sure
> > > > > that they're still working.
> > > >
> > > > $ ls t/*http-push*
> > > > t/t5540-http-push.sh
> > > >
> > > > $ git grep -n test.*rsync t/
> > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '
> > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '
> > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '
> > > >
> > > > It should be just a matter of installing an apache and rsync.
> > >
> > > And configuring them suitably, yes. That's the part I haven't previously
> > > done.
> >
> > If you have to configure apache (or rsync) for the test to run properly,
> > we have a serious bug in our test suite. Please share the output in that
> > case.
>
> rsync: failed to connect to 127.0.0.1: Connection refused (111)
> rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
> fatal: Could not run rsync to get refs
>
> I mean, I won't need to do anything really special in the configuration,
> but I do need to have rsyncd running giving access to that directory
> without any funny mapping on localhost.
That is my mistake, I guess. I tried to be lazy and not change
transport.c so that it groks "rsync:$(pwd)" style paths.
Sorry,
Dscho
^ permalink raw reply
* [PATCH] git-gui: Append ampersand to Target of lnk files created by do_cygwin_shortcut.
From: Phil Lawrence @ 2009-03-09 17:22 UTC (permalink / raw)
To: git
First post here. First patch, too, so hoping I've invoked git
format-patch correctly...
>From 5fddc9b7bfa0dfb8d2c1c0eb59ae9208ff72540d Mon Sep 17 00:00:00 2001
From: Phil Lawrence <prlawrence@gmail.com>
Date: Thu, 5 Mar 2009 17:56:58 -0600
Subject: [PATCH] Append ampersand to Target of lnk files created by
do_cygwin_shortcut. Allows shell window to close after starting
Git GUI as a background process.
---
lib/shortcut.tcl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl
index 38c3151..2f20eb3 100644
--- a/lib/shortcut.tcl
+++ b/lib/shortcut.tcl
@@ -54,7 +54,7 @@ proc do_cygwin_shortcut {} {
$argv0]
win32_create_lnk $fn [list \
$sh -c \
- "CHERE_INVOKING=1 source
/etc/profile;[sq $me]" \
+ "CHERE_INVOKING=1 source
/etc/profile;[sq $me] &" \
] \
[file dirname [file normalize [gitdir]]]
} err]} {
--
1.6.1.9.g97c34
Regards,
Phil Lawrence
^ permalink raw reply related
* Re: [PATCH 0/2] Move push logic to transport.c
From: Daniel Barkalow @ 2009-03-09 17:24 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0903091809330.6358@intel-tinevez-2-302>
On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 9 Mar 2009, Daniel Barkalow wrote:
>
> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> >
> > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> > >
> > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > > >
> > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:
> > > > >
> > > > > > It doesn't convert http-push or the rsync transports, largely
> > > > > > because I don't have test setups for rsync or webdav to make sure
> > > > > > that they're still working.
> > > > >
> > > > > $ ls t/*http-push*
> > > > > t/t5540-http-push.sh
> > > > >
> > > > > $ git grep -n test.*rsync t/
> > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '
> > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '
> > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '
> > > > >
> > > > > It should be just a matter of installing an apache and rsync.
> > > >
> > > > And configuring them suitably, yes. That's the part I haven't previously
> > > > done.
> > >
> > > If you have to configure apache (or rsync) for the test to run properly,
> > > we have a serious bug in our test suite. Please share the output in that
> > > case.
> >
> > rsync: failed to connect to 127.0.0.1: Connection refused (111)
> > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
> > fatal: Could not run rsync to get refs
> >
> > I mean, I won't need to do anything really special in the configuration,
> > but I do need to have rsyncd running giving access to that directory
> > without any funny mapping on localhost.
>
> That is my mistake, I guess. I tried to be lazy and not change
> transport.c so that it groks "rsync:$(pwd)" style paths.
Oh, I think it's probably not worth allowing rsync:$(pwd) (particularly
since rsync itself seems not to let you say "rsync:" for local paths).
I'll set something up to run rsyncd with an appropriate config, like the
lib-httpd stuff. Oh, and it looks like nobody actually runs the rsync
tests; they're broken by $(pwd) including whitespace, and haven't been
fixed yet.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: Massive spam attack on the GitWiki
From: Petr Baudis @ 2009-03-09 17:27 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0903091807240.6358@intel-tinevez-2-302>
Hi,
On Mon, Mar 09, 2009 at 06:07:40PM +0100, Johannes Schindelin wrote:
> there seems to be a spam attack on the GitWiki. Pasky, could you change
> the settings so that attachments are disallowed? It is really
> distressing. Especially since pages I delete crop up again because of
> those spammers attaching new attachments.
I have tried to disable adding new attachments now.
> Also, is it possible to remove/block users?
Probably, but I don't know how. But I have given you full admin
rights now, if you know how to use them (I don't). :-)
--
Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr
^ permalink raw reply
* Re: [PATCH 0/2] Move push logic to transport.c
From: Johannes Schindelin @ 2009-03-09 17:29 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LNX.1.00.0903091315440.19665@iabervon.org>
Hi,
On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> On Mon, 9 Mar 2009, Johannes Schindelin wrote:
>
> > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> >
> > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > >
> > > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> > > >
> > > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > > > >
> > > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:
> > > > > >
> > > > > > > It doesn't convert http-push or the rsync transports, largely
> > > > > > > because I don't have test setups for rsync or webdav to make sure
> > > > > > > that they're still working.
> > > > > >
> > > > > > $ ls t/*http-push*
> > > > > > t/t5540-http-push.sh
> > > > > >
> > > > > > $ git grep -n test.*rsync t/
> > > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '
> > > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '
> > > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '
> > > > > >
> > > > > > It should be just a matter of installing an apache and rsync.
> > > > >
> > > > > And configuring them suitably, yes. That's the part I haven't previously
> > > > > done.
> > > >
> > > > If you have to configure apache (or rsync) for the test to run properly,
> > > > we have a serious bug in our test suite. Please share the output in that
> > > > case.
> > >
> > > rsync: failed to connect to 127.0.0.1: Connection refused (111)
> > > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
> > > fatal: Could not run rsync to get refs
> > >
> > > I mean, I won't need to do anything really special in the configuration,
> > > but I do need to have rsyncd running giving access to that directory
> > > without any funny mapping on localhost.
> >
> > That is my mistake, I guess. I tried to be lazy and not change
> > transport.c so that it groks "rsync:$(pwd)" style paths.
>
> Oh, I think it's probably not worth allowing rsync:$(pwd) (particularly
> since rsync itself seems not to let you say "rsync:" for local paths).
This contradicts that:
> I'll set something up to run rsyncd with an appropriate config, like the
> lib-httpd stuff. Oh, and it looks like nobody actually runs the rsync
> tests; they're broken by $(pwd) including whitespace, and haven't been
> fixed yet.
If we would support local rsync paths, testing it would be easy.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit
From: Brandon Casey @ 2009-03-09 17:36 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, git, Chris Johnsen, Miklos Vajna
In-Reply-To: <20090308144240.GA30794@coredump.intra.peff.net>
Jeff King wrote:
> On Sat, Mar 07, 2009 at 03:30:51AM -0600, Chris Johnsen wrote:
>
>> +test_expect_code 1 'cherry-pick an empty commit' '
>> +
>> + git checkout master &&
>> + git cherry-pick empty-branch
>> +
>> +'
>
> Hmm. This test fails for me on FreeBSD. However, it seems to be related
> to a shell portability issue with the test suite. The extra newline
> inside the shell snippet seems to lose the last status. The following
> works fine for me with bash or dash:
> With this minimal example, you can see that the problem is not some
> subtle bug in the test suite:
>
> -- >8 --
> #!/bin/sh
>
> eval 'false'
> echo status is $?
> eval 'false
> '
> echo status is $?
> eval 'false
>
> '
> echo status is $?
> -- 8< --
>
> generates:
>
> status is 1
> status is 1
> status is 0
Even /bin/sh (which is unfit for git consumption) on Solaris 7 produces
non-zero for all three tests:
status is 255
status is 255
status is 255
I set SHELL_PATH=/usr/xpg4/bin/sh aka ksh when compiling git which also
handles your test correctly:
status is 1
status is 1
status is 1
IRIX6.5 /bin/sh and /bin/ksh produce the correct results also.
-brandon
^ permalink raw reply
* Re: [PATCH 0/2] Move push logic to transport.c
From: Daniel Barkalow @ 2009-03-09 18:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0903091828280.6358@intel-tinevez-2-302>
On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 9 Mar 2009, Daniel Barkalow wrote:
>
> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> >
> > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> > >
> > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > > >
> > > > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:
> > > > >
> > > > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:
> > > > > >
> > > > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:
> > > > > > >
> > > > > > > > It doesn't convert http-push or the rsync transports, largely
> > > > > > > > because I don't have test setups for rsync or webdav to make sure
> > > > > > > > that they're still working.
> > > > > > >
> > > > > > > $ ls t/*http-push*
> > > > > > > t/t5540-http-push.sh
> > > > > > >
> > > > > > > $ git grep -n test.*rsync t/
> > > > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '
> > > > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '
> > > > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '
> > > > > > >
> > > > > > > It should be just a matter of installing an apache and rsync.
> > > > > >
> > > > > > And configuring them suitably, yes. That's the part I haven't previously
> > > > > > done.
> > > > >
> > > > > If you have to configure apache (or rsync) for the test to run properly,
> > > > > we have a serious bug in our test suite. Please share the output in that
> > > > > case.
> > > >
> > > > rsync: failed to connect to 127.0.0.1: Connection refused (111)
> > > > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
> > > > fatal: Could not run rsync to get refs
> > > >
> > > > I mean, I won't need to do anything really special in the configuration,
> > > > but I do need to have rsyncd running giving access to that directory
> > > > without any funny mapping on localhost.
> > >
> > > That is my mistake, I guess. I tried to be lazy and not change
> > > transport.c so that it groks "rsync:$(pwd)" style paths.
> >
> > Oh, I think it's probably not worth allowing rsync:$(pwd) (particularly
> > since rsync itself seems not to let you say "rsync:" for local paths).
>
> This contradicts that:
>
> > I'll set something up to run rsyncd with an appropriate config, like the
> > lib-httpd stuff. Oh, and it looks like nobody actually runs the rsync
> > tests; they're broken by $(pwd) including whitespace, and haven't been
> > fixed yet.
>
> If we would support local rsync paths, testing it would be easy.
Ok, I think having transport_get strip off the "rsync:" would make it work
with the rest of the functions unchanged, which would in turn mean that
the tests would be a pretty reasonable approximation of the real-world
code.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Look and send it to your friends
From: Isabel @ 2009-03-09 18:06 UTC (permalink / raw)
To: git
Coupon&Sales http://ik.codecouponsite.com/coupons.php
^ permalink raw reply
* Re: Using Git with windows
From: Ramsay Jones @ 2009-03-09 18:29 UTC (permalink / raw)
To: pascal; +Cc: Robin Rosenberg, Tim Visher, Tariq Hassanen, git
In-Reply-To: <49B2C529.6010002@obry.net>
Pascal Obry wrote:
> Robin Rosenberg a écrit :
>> I think that worked fine when I tried using cygwin's apache. Mixing a cygwin
>> git with a win32 apache did not work well.
>
> Well, I tried with lighttpd IIRC. I do not want Apache just for browsing
> a Git repo.
>
Pascal, I also installed lighttpd on cygwin, just so that I could test gitweb
and cgit (I have Apache installed on Linux). I had a few problems getting it
to work at first. Only later did I notice that "git-instaweb" didn't work.
Having fixed the installation problems earlier, I fixed git-instaweb and then
forgot to send in the patch. Oops... Patch on the way... ;-)
[I had intended to make several other changes and submit it later...]
You may also notice that "git-instaweb" does not provide the git-logo.png
and git-favicon.png; so if that bothers you, just copy those files from
your git repo into the target repo's .git/gitweb directory. (That was one
of the things I was going to look at fixing)
<off-topic>
Note: if you decide to try cgit, then be aware that lighttpd has a bug which
causes problems with mixed-case pathnames in the pathinfo. lighttpd down-cases
the filename part of the pathinfo when on a case insensitive filesystem, so
cgit can't find the corresponding blob. (This is not a problem with gitweb).
I sent a fix for this bug to (who I thought was) the lighttpd maintainer, but
didn't get any response; so don't count on a fix for this.
An amusing, but impractical, workaround for this is to name your document root
something like /123 ie the path is numeric (and so does not differ in case ;-)
[lighttpd uses a runtime test of the case-sensitive-ness of the document root
pathname to control this behaviour]
Also, I could not get lighttpd to execute a cgi program with an ".exe" extension
so I had to create a simple script, viz:
$ cat /var/www/cgit/cgit.cgi
#!/bin/sh
exec /var/www/cgit/cgit.cgi.exe
$
<off-topic>
ATB,
Ramsay Jones
^ permalink raw reply
* [PATCH] git-instaweb: fix lighttpd configuration on cygwin
From: Ramsay Jones @ 2009-03-09 18:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list, pascal
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
A recent email from Pascal reminded me that I had this patch
kicking around. I haven't tested this on Linux, since I don't
have lighttpd installed there (I already have Apache), but I
don't expect any problems; famous last words!
The essence of the change is the addition of the "mod_setenv"
module, along with the PATH environment variable assignment.
(otherwise gitweb can't find a shell and, therefore, can't
execute any git programs)
Also, I had to add a default mime-type assignment of text/plain
("" => "text/plain"). If my memory serves me, the other additions
to the mime-type mapping was just cosmetic; and why not?
Hmmm, I just noticed that the first hunk, which is needed to
suppress a "lighttpd: not found" error message, could perhaps be
seen as an un-related fix. Dunno.
ATB,
Ramsay Jones
git-instaweb.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 0843372..5f4419b 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -49,7 +49,7 @@ resolve_full_httpd () {
esac
httpd_only="$(echo $httpd | cut -f1 -d' ')"
- if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
+ if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null 2>&1;; esac
then
full_httpd=$httpd
else
@@ -179,11 +179,74 @@ lighttpd_conf () {
cat > "$conf" <<EOF
server.document-root = "$fqgitdir/gitweb"
server.port = $port
-server.modules = ( "mod_cgi" )
+server.modules = ( "mod_setenv", "mod_cgi" )
server.indexfiles = ( "gitweb.cgi" )
server.pid-file = "$fqgitdir/pid"
+server.errorlog = "$fqgitdir/gitweb/error.log"
+
+# to enable, add "mod_access", "mod_accesslog" to server.modules
+# variable above and uncomment this
+#accesslog.filename = "$fqgitdir/gitweb/access.log"
+
+setenv.add-environment = ( "PATH" => "/usr/local/bin:/usr/bin:/bin" )
+
cgi.assign = ( ".cgi" => "" )
-mimetype.assign = ( ".css" => "text/css" )
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".cpp" => "text/plain",
+ ".log" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
+ "" => "text/plain"
+ )
EOF
test x"$local" = xtrue && echo 'server.bind = "127.0.0.1"' >> "$conf"
}
--
1.6.2
^ permalink raw reply related
* [PATCH] rsync transport: allow local paths, and fix tests
From: Johannes Schindelin @ 2009-03-09 18:44 UTC (permalink / raw)
To: git, gitster; +Cc: Daniel Barkalow
In-Reply-To: <cover.1236624246u.git.johannes.schindelin@gmx.de>
Earlier, the rsync tests were disabled by default, as they needed a
running rsyncd daemon. This was only due to the limitation that our
rsync transport only allowed full URLs of the form
rsync://<host>/<path>
Relaxing the URLs to allow
rsync:<path>
permitted the change in the tests to run whenever rsync is available,
without requiring a fully configured and running rsyncd.
While at it, the tests were fixed so that they run in directories with a
space in their name.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
t/t5510-fetch.sh | 39 ++++++++++++++++++++-------------------
transport.c | 23 +++++++++++++++--------
2 files changed, 35 insertions(+), 27 deletions(-)
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 9e679b4..bee3424 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -191,38 +191,39 @@ test_expect_success 'bundle should be able to create a full history' '
'
-test "$TEST_RSYNC" && {
+! rsync --help > /dev/null 2> /dev/null &&
+say 'Skipping rsync tests because rsync was not found' || {
test_expect_success 'fetch via rsync' '
git pack-refs &&
mkdir rsynced &&
- cd rsynced &&
- git init &&
- git fetch rsync://127.0.0.1$(pwd)/../.git master:refs/heads/master &&
- git gc --prune &&
- test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
- git fsck --full
+ (cd rsynced &&
+ git init --bare &&
+ git fetch "rsync:$(pwd)/../.git" master:refs/heads/master &&
+ git gc --prune &&
+ test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
+ git fsck --full)
'
test_expect_success 'push via rsync' '
- mkdir ../rsynced2 &&
- (cd ../rsynced2 &&
+ mkdir rsynced2 &&
+ (cd rsynced2 &&
git init) &&
- git push rsync://127.0.0.1$(pwd)/../rsynced2/.git master &&
- cd ../rsynced2 &&
- git gc --prune &&
- test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
- git fsck --full
+ (cd rsynced &&
+ git push "rsync:$(pwd)/../rsynced2/.git" master) &&
+ (cd rsynced2 &&
+ git gc --prune &&
+ test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
+ git fsck --full)
'
test_expect_success 'push via rsync' '
- cd .. &&
mkdir rsynced3 &&
(cd rsynced3 &&
git init) &&
- git push --all rsync://127.0.0.1$(pwd)/rsynced3/.git &&
- cd rsynced3 &&
- test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
- git fsck --full
+ git push --all "rsync:$(pwd)/rsynced3/.git" &&
+ (cd rsynced3 &&
+ test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
+ git fsck --full)
'
}
diff --git a/transport.c b/transport.c
index 7bc5a55..3015ed1 100644
--- a/transport.c
+++ b/transport.c
@@ -138,6 +138,11 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
}
}
+static const char *rsync_url(const char *url)
+{
+ return prefixcmp(url, "rsync://") ? skip_prefix(url, "rsync:") : url;
+}
+
static struct ref *get_refs_via_rsync(struct transport *transport)
{
struct strbuf buf = STRBUF_INIT, temp_dir = STRBUF_INIT;
@@ -153,7 +158,7 @@ static struct ref *get_refs_via_rsync(struct transport *transport)
die ("Could not make temporary directory");
temp_dir_len = temp_dir.len;
- strbuf_addstr(&buf, transport->url);
+ strbuf_addstr(&buf, rsync_url(transport->url));
strbuf_addstr(&buf, "/refs");
memset(&rsync, 0, sizeof(rsync));
@@ -169,7 +174,7 @@ static struct ref *get_refs_via_rsync(struct transport *transport)
die ("Could not run rsync to get refs");
strbuf_reset(&buf);
- strbuf_addstr(&buf, transport->url);
+ strbuf_addstr(&buf, rsync_url(transport->url));
strbuf_addstr(&buf, "/packed-refs");
args[2] = buf.buf;
@@ -206,7 +211,7 @@ static int fetch_objs_via_rsync(struct transport *transport,
const char *args[8];
int result;
- strbuf_addstr(&buf, transport->url);
+ strbuf_addstr(&buf, rsync_url(transport->url));
strbuf_addstr(&buf, "/objects/");
memset(&rsync, 0, sizeof(rsync));
@@ -285,7 +290,7 @@ static int rsync_transport_push(struct transport *transport,
/* first push the objects */
- strbuf_addstr(&buf, transport->url);
+ strbuf_addstr(&buf, rsync_url(transport->url));
strbuf_addch(&buf, '/');
memset(&rsync, 0, sizeof(rsync));
@@ -306,7 +311,8 @@ static int rsync_transport_push(struct transport *transport,
args[i++] = NULL;
if (run_command(&rsync))
- return error("Could not push objects to %s", transport->url);
+ return error("Could not push objects to %s",
+ rsync_url(transport->url));
/* copy the refs to the temporary directory; they could be packed. */
@@ -327,10 +333,11 @@ static int rsync_transport_push(struct transport *transport,
if (!(flags & TRANSPORT_PUSH_FORCE))
args[i++] = "--ignore-existing";
args[i++] = temp_dir.buf;
- args[i++] = transport->url;
+ args[i++] = rsync_url(transport->url);
args[i++] = NULL;
if (run_command(&rsync))
- result = error("Could not push to %s", transport->url);
+ result = error("Could not push to %s",
+ rsync_url(transport->url));
if (remove_dir_recursively(&temp_dir, 0))
warning ("Could not remove temporary directory %s.",
@@ -705,7 +712,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
ret->remote = remote;
ret->url = url;
- if (!prefixcmp(url, "rsync://")) {
+ if (!prefixcmp(url, "rsync:")) {
ret->get_refs_list = get_refs_via_rsync;
ret->fetch = fetch_objs_via_rsync;
ret->push = rsync_transport_push;
--
1.6.2.363.g9793e
^ permalink raw reply related
* Re: [PATCH] grep: make show_line more portable
From: René Scharfe @ 2009-03-09 19:34 UTC (permalink / raw)
To: Brian Gernhardt, Junio C Hamano; +Cc: Jay Soffian, Git List
In-Reply-To: <5ACAF49A-84B5-4F55-A8B8-0FC711708810@silverinsanity.com>
Brian Gernhardt schrieb:
>
> On Mar 8, 2009, at 10:22 PM, Jay Soffian wrote:
>
>> On Sun, Mar 8, 2009 at 9:15 PM, Brian Gernhardt
>> <benji@silverinsanity.com> wrote:
>>> On OS X the printf specifier "%.0s" outputs the entire string instead
>>> of 0 characters as POSIX states.
>>
>> Does not reproduce for me:
>
> Nor for me, as I noted on the other thread... And looking again, I was
> reading the man page for printf(1), not printf(3). Ouch. *grumble,
> grumble* I'm crawling back under my rock now.
Sorry for introducing a Linuxism. :-/ Thanks for testing and reporting
and for fixing the bug.
René
^ permalink raw reply
* [RFC with a proof of concept PATCH] Add Bonsai-like query options to gitk
From: newren @ 2009-03-09 19:42 UTC (permalink / raw)
To: git; +Cc: angavrilov, paulus, Elijah Newren
From: Elijah Newren <newren@gmail.com>
Hi,
(If you like screenshots, I've got some before & after ones up at
http://www.gnome.org/~newren/temp/gitk/gitk-edit-view.html, but
remember that this is just a proof of concept and call for comments.)
I've talked a little bit with the Trilinos project[1] about git. One
issue that has come up is that they need a replacement for Bonsai (see
http://bonsai.mozilla.org/cvsqueryform.cgi). When I pointed out git
log and its many option, I was told that they wanted something that
would only be used infrequently by any given individual, and thus they
wanted something that didn't require memorizing or looking up command
line options. gitk, particularly the View->Edit View menu option,
looks like a step in the right direction. I'm guessing that with a
tweak or two, it could probably satisfy this use case. The issues I
see are:
* many important options (--author, --grep, -S, --pickaxe-regex) are
still selected in gitk by typing in command line options into the
appropriate box
* the format of some fields is not clear; examples: (1) it is not
clear which date format is acceptable, and (2) it is not clear
that the "Skip" field takes integers as input.
My below proof of concept patch:
* Adds options for selecting revisions based on branch/tag names,
author, committer, commit message, and patch contents (technically
this was all available before, but only if you were familiar with
the command line options to git log)
* Provides hints for input format (for example, lists some sample
date strings in a few different formats)
* Puts related query items into subsections, to make it easier to
digest the sheer number of options that now exist
* Rearranges the previous dialog options due to the above changes
Potential issues with my patch:
* Maybe this is the wrong place to put Bonsai-like querying and I
should look at gitweb or cgit instead (while I personally like
client-side solutions, maybe others won't?) Further, this may
push gitk in a way that others don't like.
* I'm pretty sure I broke the view remembering feature. I can work
on fixing this up if people generally like the idea behind the
patch.
* Is this dialog too overwhelming or too large now?
* My lack of Tcl/Tk skills, and UI design skills.
Elijah
[1] http://trilinos.sandia.gov/ I'm not part of the Trilinos project;
I'm just a co-worker.
---
gitk-git/gitk | 95 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 69 insertions(+), 26 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1773ae6..79f18b5 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -3631,17 +3631,35 @@ proc newview {ishighlight} {
}
set known_view_options {
- {perm b . {} {mc "Remember this view"}}
- {args t50= + {} {mc "Commits to include (arguments to git log):"}}
- {all b * "--all" {mc "Use all refs"}}
- {dorder b . {"--date-order" "-d"} {mc "Strictly sort by date"}}
- {lright b . "--left-right" {mc "Mark branch sides"}}
- {since t15 + {"--since=*" "--after=*"} {mc "Since date:"}}
- {until t15 . {"--until=*" "--before=*"} {mc "Until date:"}}
- {limit t10 + "--max-count=*" {mc "Max count:"}}
- {skip t10 . "--skip=*" {mc "Skip:"}}
- {first b . "--first-parent" {mc "Limit to first parent"}}
- {cmd t50= + {} {mc "Command to generate more commits to include:"}}
+ {perm b . {} {mc "Remember this view"}}
+ {reflabel l + {} {mc "References (space separated list):"}}
+ {refs t15 .. {} {mc "Branches & tags:"}}
+ {allrefs b *. "--all" {mc "All refs"}}
+ {branches b . "--branches" {mc "All (local) branches"}}
+ {tags b . "--tags" {mc "All tags"}}
+ {remotes b . "--remotes" {mc "All remote-tracking branches"}}
+ {commitlbl l + {} {mc "Commit Info (regular expressions):"}}
+ {author t15 .. "--author=*" {mc "Author:"}}
+ {committer t15 . "--committer=*" {mc "Committer:"}}
+ {loginfo t15 .. "--grep=*" {mc "Commit Message:"}}
+ {allmatch b .. "--all-match" {mc "Matches all Commit Info criteria"}}
+ {changes_l l + {} {mc "Changes to Files:"}}
+ {pickaxe_s r0 . {} {mc "Fixed String"}}
+ {pickaxe_t r1 . "--pickaxe-regex" {mc "Regular Expression"}}
+ {pickaxe t15 .. "-S*" {mc "Search string:"}}
+ {datelabel l + {} {mc "Commit Dates (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 15:27:38\"):"}}
+ {since t15 .. {"--since=*" "--after=*"} {mc "Since:"}}
+ {until t15 . {"--until=*" "--before=*"} {mc "Until:"}}
+ {limit_lbl l + {} {mc "Limit and/or skip a number of revisions (positive integer):"}}
+ {limit t10 *. "--max-count=*" {mc "Number to show:"}}
+ {skip t10 . "--skip=*" {mc "Number to skip:"}}
+ {misc_lbl l + {} {mc "Miscellaneous options:"}}
+ {dorder b *. {"--date-order" "-d"} {mc "Strictly sort by date"}}
+ {lright b . "--left-right" {mc "Mark branch sides"}}
+ {first b . "--first-parent" {mc "Limit to first parent"}}
+ {args t50 *. {} {mc "Additional arguments to git log:"}}
+ {allpaths path + {} {mc "Enter files and directories to include, one per line:"}}
+ {cmd t50= + {} {mc "Command to generate more commits to include:"}}
}
proc encode_view_opts {n} {
@@ -3659,6 +3677,11 @@ proc encode_view_opts {n} {
if {$val} {
lappend rargs $pattern
}
+ } elseif {[regexp {^r(\d+)$} [lindex $opt 1] type value]} {
+ regexp {^(.*_)} [lindex $opt 0] uselessvar button_id
+ if {$newviewopts($n,$button_id) eq $value} {
+ lappend rargs $pattern
+ }
} else {
set val [string trim $val]
if {$val ne {}} {
@@ -3667,6 +3690,7 @@ proc encode_view_opts {n} {
}
}
}
+ set rargs [concat $rargs [shellsplit $newviewopts($n,refs)]]
return [concat $rargs [shellsplit $newviewopts($n,args)]]
}
@@ -3757,6 +3781,11 @@ proc vieweditor {top n title} {
pack $top.name -in $top.nfr -side left
# View options
+ frame $top.ifr
+ label $top.il -text [mc "* Please specify criteria for selecting revisions to view * "]
+ pack $top.il -anchor center
+
+ # View options
set cframe $top.nfr
set cexpand 0
set cnt 0
@@ -3773,14 +3802,29 @@ proc vieweditor {top n title} {
frame $cframe
pack $cframe -in $top -fill x -pady 3 -padx 3
set cexpand [expr {$flags eq "*"}]
+ } elseif {$flags eq ".." || $flags eq "*."} {
+ set cframe $top.fr$cnt
+ incr cnt
+ frame $cframe
+ pack $cframe -in $top -fill x -pady 3 -padx [list 15 3]
+ set cexpand [expr {$flags eq "*."}]
} else {
set lxpad 5
}
- if {$type eq "b"} {
+ if {$type eq "l"} {
+ label $cframe.l_$id -text $title
+ pack $cframe.l_$id -in $cframe -side left -pady [list 3 0] -anchor w
+ } elseif {$type eq "b"} {
checkbutton $cframe.c_$id -text $title -variable newviewopts($n,$id)
pack $cframe.c_$id -in $cframe -side left \
-padx [list $lxpad 0] -expand $cexpand -anchor w
+ } elseif {[regexp {^r(\d+)$} $type type sz]} {
+ regexp {^(.*_)} $id uselessvar button_id
+ set newviewopts($n,$button_id) 0
+ radiobutton $cframe.c_$id -text $title -variable newviewopts($n,$button_id) -value $sz
+ pack $cframe.c_$id -in $cframe -side left \
+ -padx [list $lxpad 0] -expand $cexpand -anchor w
} elseif {[regexp {^t(\d+)$} $type type sz]} {
message $cframe.l_$id -aspect 1500 -text $title
entry $cframe.e_$id -width $sz -background $bgcolor \
@@ -3793,23 +3837,22 @@ proc vieweditor {top n title} {
-textvariable newviewopts($n,$id)
pack $cframe.l_$id -in $cframe -side top -pady [list 3 0] -anchor w
pack $cframe.e_$id -in $cframe -side top -fill x
+ } elseif {$type eq "path"} {
+ message $top.l -aspect 1500 -text $title
+ pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3
+ text $top.t -width 40 -height 5 -background $bgcolor -font uifont
+ if {[info exists viewfiles($n)]} {
+ foreach f $viewfiles($n) {
+ $top.t insert end $f
+ $top.t insert end "\n"
+ }
+ $top.t delete {end - 1c} end
+ $top.t mark set insert 0.0
+ }
+ pack $top.t -in $top -side top -pady [list 0 5] -fill both -expand 1 -padx 3
}
}
- # Path list
- message $top.l -aspect 1500 \
- -text [mc "Enter files and directories to include, one per line:"]
- pack $top.l -in $top -side top -pady [list 7 0] -anchor w -padx 3
- text $top.t -width 40 -height 5 -background $bgcolor -font uifont
- if {[info exists viewfiles($n)]} {
- foreach f $viewfiles($n) {
- $top.t insert end $f
- $top.t insert end "\n"
- }
- $top.t delete {end - 1c} end
- $top.t mark set insert 0.0
- }
- pack $top.t -in $top -side top -pady [list 0 5] -fill both -expand 1 -padx 3
frame $top.buts
button $top.buts.ok -text [mc "OK"] -command [list newviewok $top $n]
button $top.buts.apply -text [mc "Apply (F5)"] -command [list newviewok $top $n 1]
--
1.6.2.95.g934f7
^ permalink raw reply related
* Re: [PATCH] git-gui: Append ampersand to Target of lnk files created by do_cygwin_shortcut.
From: Johannes Schindelin @ 2009-03-09 20:13 UTC (permalink / raw)
To: Phil Lawrence; +Cc: git
In-Reply-To: <530ac78e0903091022s2585231br9ef11d91851250f4@mail.gmail.com>
Hi,
On Mon, 9 Mar 2009, Phil Lawrence wrote:
> >From 5fddc9b7bfa0dfb8d2c1c0eb59ae9208ff72540d Mon Sep 17 00:00:00 2001
> From: Phil Lawrence <prlawrence@gmail.com>
> Date: Thu, 5 Mar 2009 17:56:58 -0600
> Subject: [PATCH] Append ampersand to Target of lnk files created by
> do_cygwin_shortcut. Allows shell window to close after starting
> Git GUI as a background process.
>
> ---
A few comments.
Usually we try to use that subject as the subject of the mail, and we also
try to keep the subject shorter than 77 characters (so that "git log" on
an 80-column display does not need to wrap lines).
Also, we like authors to provide Signed-off-by: lines.
Now, with the technical stuff out of the way: are you not changing
behavior? It seems that Linux users expect an program called by a menu
item to block the application until the program returns, so that an error
can be caught.
Maybe the expectation is different on Windows? But then, we'd still like
to catch errors and warn the user about it, right?
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 3/4] parseopt: make usage optional
From: René Scharfe @ 2009-03-09 20:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, carlos.duclos, Pierre Habouzit
In-Reply-To: <7vr617kbit.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>
>> Allow usagestr to be NULL and don't display anything a help screen in
>> this case. This is useful to implement incremental parsers.
>
> Can I amend "s/anything a/any/"?
Oh, definitely.
Thanks,
René
^ permalink raw reply
* [PATCH 5/4] parseopt: document KEEP_ARGV0, KEEP_UNKNOWN, NO_INTERNAL_HELP
From: René Scharfe @ 2009-03-09 20:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, carlos.duclos, Pierre Habouzit
In-Reply-To: <7vvdqjkbka.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
Documentation/technical/api-parse-options.txt | 27 +++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 539863b..dc72987 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -66,6 +66,12 @@ Steps to parse options
non-option arguments in `argv[]`.
`argc` is updated appropriately because of the assignment.
+
+You can also pass NULL instead of a usage array as fourth parameter of
+parse_options(), to avoid displaying a help screen with usage info and
+option list. This should only be done if necessary, e.g. to implement
+a limited parser for only a subset of the options that needs to be run
+before the full parser, which in turn shows the full help message.
++
Flags are the bitwise-or of:
`PARSE_OPT_KEEP_DASHDASH`::
@@ -77,6 +83,27 @@ Flags are the bitwise-or of:
Using this flag, processing is stopped at the first non-option
argument.
+`PARSE_OPT_KEEP_ARGV0`::
+ Keep the first argument, which contains the program name. It's
+ removed from argv[] by default.
+
+`PARSE_OPT_KEEP_UNKNOWN`::
+ Keep unknown arguments instead of erroring out. This doesn't
+ work for all combinations of arguments as users might expect
+ it to do. E.g. if the first argument in `--unknown --known`
+ takes a value (which we can't know), the second one is
+ mistakenly interpreted as a known option. Similarly, if
+ `PARSE_OPT_STOP_AT_NON_OPTION` is set, the second argument in
+ `--unknown value` will be mistakenly interpreted as a
+ non-option, not as a value belonging to the unknown option,
+ stopping the parser early.
+
+`PARSE_OPT_NO_INTERNAL_HELP`::
+ By default, parse_options() handles `-h`, `--help` and
+ `--help-all` internally, by showing a help screen. This option
+ turns it off and allows one to add custom handlers for these
+ options, or to just leave them unknown.
+
Data Structure
--------------
--
1.6.2
^ permalink raw reply related
* Re: [RFC PATCH] git push: Push nothing if no refspecs are given or configured
From: Markus Heidelberg @ 2009-03-09 20:39 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Finn Arne Gangstad, git, John Tapsell, Andreas Ericsson
In-Reply-To: <alpine.DEB.1.00.0903061126550.10279@pacific.mpi-cbg.de>
Johannes Schindelin, 06.03.2009:
> > -already exists on the remote side. This is the default operation mode
> > +already exists on the remote side. Nothing will be pushed
>
> The two spaces after the full stop were not actually a typo.
What's its purpose? Just recently I added "set nojoinspaces" to my
.vimrc to not insert two spaces when joining sentences.
Markus
^ permalink raw reply
* Re: [RFC PATCH] git push: Push nothing if no refspecs are given or configured
From: Johannes Schindelin @ 2009-03-09 20:48 UTC (permalink / raw)
To: Markus Heidelberg; +Cc: Finn Arne Gangstad, git, John Tapsell, Andreas Ericsson
In-Reply-To: <200903092139.35788.markus.heidelberg@web.de>
Hi,
On Mon, 9 Mar 2009, Markus Heidelberg wrote:
> Johannes Schindelin, 06.03.2009:
> > > -already exists on the remote side. This is the default operation mode
> > > +already exists on the remote side. Nothing will be pushed
> >
> > The two spaces after the full stop were not actually a typo.
>
> What's its purpose? Just recently I added "set nojoinspaces" to my
> .vimrc to not insert two spaces when joining sentences.
It was explained to me as "English grammar". Two spaces after a full
stop.
Ciao,
Dscho
^ permalink raw reply
* [PATCH 6/4] parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together
From: René Scharfe @ 2009-03-09 20:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, carlos.duclos, Pierre Habouzit
In-Reply-To: <7vvdqjkbka.fsf@gitster.siamese.dyndns.org>
As suggested by Junio, disallow the flags PARSE_OPT_KEEP_UNKNOWN and
PARSE_OPT_STOP_AT_NON_OPTION to be turned on at the same time, as a
value of an unknown option could be mistakenly classified as a
non-option, stopping the parser early. E.g.:
git cmd --known --unknown value arg0 arg1
The parser should have stopped at "arg0", but it already stops at
"value".
This patch makes parse_options() die if the two flags are used in
combination.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
Documentation/technical/api-parse-options.txt | 3 ++-
parse-options.c | 3 +++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index dc72987..f5d4ac1 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -96,7 +96,8 @@ Flags are the bitwise-or of:
`PARSE_OPT_STOP_AT_NON_OPTION` is set, the second argument in
`--unknown value` will be mistakenly interpreted as a
non-option, not as a value belonging to the option, stopping
- the parser early.
+ the parser early. That's why parse_options() errors out if
+ both options are set.
`PARSE_OPT_NO_INTERNAL_HELP`::
By default, parse_options() handles `-h`, `--help` and
diff --git a/parse-options.c b/parse-options.c
index 51e804b..cf71bcf 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -244,6 +244,9 @@ void parse_options_start(struct parse_opt_ctx_t *ctx,
ctx->out = argv;
ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0);
ctx->flags = flags;
+ if ((flags & PARSE_OPT_KEEP_UNKNOWN) &&
+ (flags & PARSE_OPT_STOP_AT_NON_OPTION))
+ die("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
}
static int usage_with_options_internal(const char * const *,
--
1.6.2
^ permalink raw reply related
* Re: [RFC PATCH] git-svn does not support intermediate directories?
From: Michael Lai @ 2009-03-09 21:02 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <20090308044318.GA31205@untitled>
> Your patch was whitespace damaged and lacked a proposed commit message.
> Please read Documentation/SubmittingPatches next time.
Hey Eric,
Sorry, I didn't notice that; I've read through it and hopefully my
patches should conform from now on.
>
> Anyhow, I fixed your patch up a bit. Can you sign-off on it
> if its right to you or let me know if it's broken? Thanks.
I looked through the patch and that would work, but at the same time I
had another idea which may be a little cleaner. Let me know what you
think.
From ae38acf85cfc86c075578c1c3f3c204d91d1d1f4 Mon Sep 17 00:00:00 2001
From: Michael Lai <myllai@gmail.com>
Date: Mon, 9 Mar 2009 11:45:47 -0700
Subject: [PATCH] git-svn: support intermediate paths when matching tags/branches
For repositories laid out like the following:
[svn-remote "svn"]
url = http://foo.com/svn/repos/bar
fetch = myproject/trunk:refs/remotes/trunk
branches = bar/myproject/branches/*:refs/remotes/*
tags = bar/myproject/tags/*:refs/remotes/tags/*
The "bar" component above is considered the intermediate path
and was not handled correctly.
Signed-off-by: Michael Lai <myllai@gmail.com>
---
git-svn.perl | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 959eb52..8be6be0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2351,7 +2351,10 @@ sub match_paths {
if (my $path = $paths->{"/$self->{path}"}) {
return ($path->{action} eq 'D') ? 0 : 1;
}
- $self->{path_regex} ||= qr/^\/\Q$self->{path}\E\//;
+ my $repos_root = $self->ra->{repos_root};
+ my $extended_path = $self->{url} . '/' . $self->{path};
+ $extended_path =~ s#^\Q$repos_root\E(/|$)##;
+ $self->{path_regex} ||= qr/^\/\Q$extended_path\E\//;
if (grep /$self->{path_regex}/, keys %$paths) {
return 1;
}
--
1.6.2
>
> From cddc7e5bde060eb963534156ae0daaf41c87c21a Mon Sep 17 00:00:00 2001
> From: Eric Wong <normalperson@yhbt.net>
> Date: Sat, 7 Mar 2009 20:22:29 -0800
> Subject: [PATCH] git-svn: support intermediate paths when matching tags/branches
> MIME-Version: 1.0
> Content-Type: text/plain; charset=utf-8
> Content-Transfer-Encoding: 8bit
>
> For repositories laid out like the following:
>
>> [svn-remote "svn"]
>> url = http://foo.com/svn/repos/bar
>> fetch = myproject/trunk:refs/remotes/trunk
>> branches = bar/myproject/branches/*:refs/remotes/*
>> tags = bar/myproject/tags/*:refs/remotes/tags/*
>
> The "bar" component above is considered the intermediate path
> and was not handled correctly.
>
> This patch was originally by Michael Lai (without a commit
> message) with some minor fixes:
>
> * extraneous slash removed from $intermediate_path,
> this was causing tests to fail.
>
> * fixed a case where $intermediate_path could be "0" and
> considered false by Perl, preventing the necessary
> slash from being appended.
>
> Signed-off-by: Eric Wong <normalperson@yhbt.net>
> ---
> git-svn.perl | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 959eb52..745dd03 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -2351,7 +2351,11 @@ sub match_paths {
> if (my $path = $paths->{"/$self->{path}"}) {
> return ($path->{action} eq 'D') ? 0 : 1;
> }
> - $self->{path_regex} ||= qr/^\/\Q$self->{path}\E\//;
> + my $repos_root = $self->ra->{repos_root};
> + my $intermediate_path = $self->{url};
> + $intermediate_path =~ s#^\Q$repos_root\E(/|$)##;
> + $intermediate_path .= '/' if length($intermediate_path) > 0;
> + $self->{path_regex} ||= qr/^\/\Q$intermediate_path$self->{path}\E\//;
> if (grep /$self->{path_regex}/, keys %$paths) {
> return 1;
> }
> --
> Eric Wong
>
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox