* Re: [PATCH v2] mergetool: support setting path to tool as config var mergetool.<tool>.path
From: Theodore Tso @ 2007-10-14 13:02 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Git Mailing List
In-Reply-To: <06B63221-7F8E-42FF-959F-D83FBABA6790@zib.de>
On Sun, Oct 14, 2007 at 02:52:25PM +0200, Steffen Prohaska wrote:
>
>> This commit adds a mechanism to provide absolute paths to the
>> external programs called by 'git mergetool'. A path can be
>> specified in the configuation variable mergetool.<tool>.path.
>
> Any news on this patch?
> Will you apply it (or recommend that Junio does)?
Hmm, for some reason I never received the v2 version of the patch. I
see Johannes' comments to it, but not the original e-mail for some
reason. It doesn't seem to be in the spam filter, so I'm not sure
what happened.
Can you resend, please? Thanks!!
- Ted
^ permalink raw reply
* Re: [PATCH] [BUG FIXED 2] git-add (-a|-u) and -n support
From: Matthieu Moy @ 2007-10-14 13:25 UTC (permalink / raw)
To: Michael Witten; +Cc: git
In-Reply-To: <E857D120-787F-460B-A167-4B5F4BD2C3B5@mit.edu>
Michael Witten <mfwitten@MIT.EDU> writes:
> Subject: [PATCH] git-add now understands two kinds of update:
>
> -u: update as before
> -a: update all as in a true 'git commit -a'
I don't find the option set very intuitive. I'd prefer
- git add -u . => update the current directory as before
- git add -u => update all files from the root.
But your solution has the advantage of being backward compatible, so,
no strong opinion here.
(side note: also, while you're here, it would be nice to have a single
command to do "git add .; git add -u", i.e add all unknown files,
update all existing files, and actally remove all deleted files. In
one word, synchronize the index with the working tree completely.
Perhaps "-a" would be a good name for that, not sure)
> builtin-add.c | 69 +++++++++++++++++++++++++++++++++++++
> +-------------------
Your patch is whitespace-damaged. I don't know how to fix that for
Apple Mail, but git-send-email can help.
> static const char builtin_add_usage[] =
> "git-add [-n] [-v] [-f] [--interactive | -i] [-u] [--refresh] [--]
> <filepattern>...";
You should document -a here, and in Documentation/git-add.txt if you
introduce it.
--
Matthieu
^ permalink raw reply
* [PATCH] Simplify usage string printing
From: Jonas Fonseca @ 2007-10-14 14:01 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git, Junio C Hamano
In-Reply-To: <1192282153-26684-10-git-send-email-madcoder@debian.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
builtin-branch.c | 1 -
builtin-update-ref.c | 1 -
parse-options.c | 2 +-
3 files changed, 1 insertions(+), 3 deletions(-)
Pierre Habouzit <madcoder@debian.org> wrote Sat, Oct 13, 2007:
> Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> ---
> builtin-update-ref.c | 71 +++++++++++++++++++++-----------------------------
> 1 files changed, 30 insertions(+), 41 deletions(-)
>
> diff --git a/builtin-update-ref.c b/builtin-update-ref.c
> index fe1f74c..eafb642 100644
> --- a/builtin-update-ref.c
> +++ b/builtin-update-ref.c
> @@ -1,59 +1,48 @@
> #include "cache.h"
> #include "refs.h"
> #include "builtin.h"
> +#include "parse-options.h"
>
> -static const char git_update_ref_usage[] =
> -"git-update-ref [-m <reason>] (-d <refname> <value> | [--no-deref] <refname> <value> [<oldval>])";
> +static const char * const git_update_ref_usage[] = {
> + "",
> + "git-update-ref [options] -d <refname> <oldval>",
> + "git-update-ref [options] <refname> <newval> [<oldval>]",
> + NULL
> +};
How about something like this to get rid of these empty strings
that look strange?
> ./git update-ref -h
usage: git-update-ref [options] -d <refname> <oldval>
or: git-update-ref [options] <refname> <newval> [<oldval>]
-m <reason> reason of the update
-d deletes the reference
--no-deref update <refname> not the one it points to
diff --git a/builtin-branch.c b/builtin-branch.c
index fbf983e..d7c4657 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -14,7 +14,6 @@
#include "parse-options.h"
static const char * const builtin_branch_usage[] = {
- "",
"git-branch [options] [-r | -a]",
"git-branch [options] [-l] [-f] <branchname> [<start-point>]",
"git-branch [options] [-r] (-d | -D) <branchname>",
diff --git a/builtin-update-ref.c b/builtin-update-ref.c
index d66d9b5..0cd7817 100644
--- a/builtin-update-ref.c
+++ b/builtin-update-ref.c
@@ -4,7 +4,6 @@
#include "parse-options.h"
static const char * const git_update_ref_usage[] = {
- "",
"git-update-ref [options] -d <refname> <oldval>",
"git-update-ref [options] <refname> <newval> [<oldval>]",
NULL
diff --git a/parse-options.c b/parse-options.c
index c45bb9b..b1d9608 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -181,7 +181,7 @@ void usage_with_options(const char * const *usagestr,
{
fprintf(stderr, "usage: %s\n", *usagestr);
while (*++usagestr)
- fprintf(stderr, " %s\n", *usagestr);
+ fprintf(stderr, " or: %s\n", *usagestr);
if (opts->type != OPTION_GROUP)
fputc('\n', stderr);
--
1.5.3.4.1166.gf076
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH] Update manpages to reflect new short and long option aliases
From: Jonas Fonseca @ 2007-10-14 14:10 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git, Junio C Hamano
In-Reply-To: <1192282153-26684-2-git-send-email-madcoder@debian.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-add.txt | 4 ++--
Documentation/git-branch.txt | 2 +-
Documentation/git-mv.txt | 2 +-
Documentation/git-rm.txt | 4 ++--
Documentation/git-symbolic-ref.txt | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
Maybe this should wait, but it is just to document that this series (as
of the version in your git tree) also adds new option aliases.
BTW, I didn't bother to change the synopsis lines but maybe I should.
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 2fe7355..963e1ab 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -50,10 +50,10 @@ OPTIONS
and `dir/file2`) can be given to add all files in the
directory, recursively.
--n::
+-n, \--dry-run::
Don't actually add the file(s), just show if they exist.
--v::
+-v, \--verbose::
Be verbose.
-f::
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index b7285bc..5e81aa4 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -85,7 +85,7 @@ OPTIONS
-a::
List both remote-tracking branches and local branches.
--v::
+-v, --verbose::
Show sha1 and commit subject line for each head.
--abbrev=<length>::
diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt
index 2c9cf74..3b8ca76 100644
--- a/Documentation/git-mv.txt
+++ b/Documentation/git-mv.txt
@@ -34,7 +34,7 @@ OPTIONS
condition. An error happens when a source is neither existing nor
controlled by GIT, or when it would overwrite an existing
file unless '-f' is given.
--n::
+-n, \--dry-run::
Do nothing; only show what would happen
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index be61a82..48c1d97 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -30,7 +30,7 @@ OPTIONS
-f::
Override the up-to-date check.
--n::
+-n, \--dry-run::
Don't actually remove the file(s), just show if they exist in
the index.
@@ -51,7 +51,7 @@ OPTIONS
\--ignore-unmatch::
Exit with a zero status even if no files matched.
-\--quiet::
+-q, \--quiet::
git-rm normally outputs one line (in the form of an "rm" command)
for each file removed. This option suppresses that output.
diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt
index a88f722..694caba 100644
--- a/Documentation/git-symbolic-ref.txt
+++ b/Documentation/git-symbolic-ref.txt
@@ -26,7 +26,7 @@ a regular file whose contents is `ref: refs/heads/master`.
OPTIONS
-------
--q::
+-q, --quiet::
Do not issue an error message if the <name> is not a
symbolic ref but a detached HEAD; instead exit with
non-zero status silently.
--
1.5.3.4.1166.gf076
--
Jonas Fonseca
^ permalink raw reply related
* git blame crashes with internal error
From: Björn Steinbrink @ 2007-10-14 14:36 UTC (permalink / raw)
To: gitster; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
Hi Junio,
git blame just decided to crash on me, when I tried to use it while
resolving a merge conflict. Interesting is probably, that it crashes
when given the filename of a file that is not _directly_ affected by the
merge, but contains code that originates from a file that caused
conlicts.
Error message is:
fatal: internal error: ce_mode is 0
I tried all git releases from 1.5.3 to 1.5.3.4 as well as the current
master and all of them crashed. A small shell script to reproduce the
problem is attached.
Thanks,
Björn
[-- Attachment #2: testcase.sh --]
[-- Type: application/x-sh, Size: 842 bytes --]
^ permalink raw reply
* Re: git blame crashes with internal error
From: Andreas Ericsson @ 2007-10-14 14:51 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: gitster, git
In-Reply-To: <20071014143628.GA22568@atjola.homenet>
Björn Steinbrink wrote:
>
> I tried all git releases from 1.5.3 to 1.5.3.4 as well as the current
> master and all of them crashed. A small shell script to reproduce the
> problem is attached.
>
Manual bisect? Ugh. This *is* the century of the competent developer
tools, you know... ;-)
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: git blame crashes with internal error
From: David Kastrup @ 2007-10-14 14:56 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Björn Steinbrink, gitster, git
In-Reply-To: <47122D02.9060204@op5.se>
Andreas Ericsson <ae@op5.se> writes:
> Björn Steinbrink wrote:
>>
>> I tried all git releases from 1.5.3 to 1.5.3.4 as well as the current
>> master and all of them crashed. A small shell script to reproduce the
>> problem is attached.
>>
>
> Manual bisect? Ugh. This *is* the century of the competent developer
> tools, you know... ;-)
It's not a "bisect" when it crashes in all versions.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: Christian Couder @ 2007-10-14 15:09 UTC (permalink / raw)
To: David Kastrup; +Cc: Wincent Colaiuta, Junio Hamano, Johannes Schindelin, git
In-Reply-To: <854pgtonp5.fsf@lola.goethe.zz>
Le dimanche 14 octobre 2007, David Kastrup a écrit :
> Wincent Colaiuta <win@wincent.com> writes:
> > El 14/10/2007, a las 14:28, Christian Couder escribió:
> >> Here is my bisect dunno patch series again.
> >
> > Good work on the series, Christian, but don't you think that
> > "unknown" would sound a little bit better than "dunno"? For people
> > who don't speak English as a second language "dunno" might not be
> > immediately clear.
>
> "undecided"?
I choosed "dunno" because that was what Dscho suggested in this thread:
http://thread.gmane.org/gmane.comp.version-control.git/53584/focus=53595
It seems to me short and understandable at the same time.
More meaningfull would be "untestable" or "cannottest" or "canttest" but
it's much longer, while "good" and "bad" are short.
Christian.
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: David Kastrup @ 2007-10-14 15:09 UTC (permalink / raw)
To: Christian Couder; +Cc: Wincent Colaiuta, Junio Hamano, Johannes Schindelin, git
In-Reply-To: <200710141709.51579.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
> Le dimanche 14 octobre 2007, David Kastrup a écrit :
>> Wincent Colaiuta <win@wincent.com> writes:
>> > El 14/10/2007, a las 14:28, Christian Couder escribió:
>> >> Here is my bisect dunno patch series again.
>> >
>> > Good work on the series, Christian, but don't you think that
>> > "unknown" would sound a little bit better than "dunno"? For people
>> > who don't speak English as a second language "dunno" might not be
>> > immediately clear.
>>
>> "undecided"?
>
> I choosed "dunno" because that was what Dscho suggested in this thread:
>
> http://thread.gmane.org/gmane.comp.version-control.git/53584/focus=53595
I would think that tongue-in-cheek. In case it was serious, I'd
consider it one of those cases where it would make good sense to
overrule the geek penchant for quirkiness.
Just think about the nuisance of finding adequate translations in
i18n: "Woaßnet", "Eh?", "Chepas" etc.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: Andreas Ericsson @ 2007-10-14 15:14 UTC (permalink / raw)
To: David Kastrup
Cc: Christian Couder, Wincent Colaiuta, Junio Hamano,
Johannes Schindelin, git
In-Reply-To: <85d4vhn35z.fsf@lola.goethe.zz>
David Kastrup wrote:
> Christian Couder <chriscool@tuxfamily.org> writes:
>
>> Le dimanche 14 octobre 2007, David Kastrup a écrit :
>>> Wincent Colaiuta <win@wincent.com> writes:
>>>> El 14/10/2007, a las 14:28, Christian Couder escribió:
>>>>> Here is my bisect dunno patch series again.
>>>> Good work on the series, Christian, but don't you think that
>>>> "unknown" would sound a little bit better than "dunno"? For people
>>>> who don't speak English as a second language "dunno" might not be
>>>> immediately clear.
>>> "undecided"?
>> I choosed "dunno" because that was what Dscho suggested in this thread:
>>
>> http://thread.gmane.org/gmane.comp.version-control.git/53584/focus=53595
>
> I would think that tongue-in-cheek. In case it was serious, I'd
> consider it one of those cases where it would make good sense to
> overrule the geek penchant for quirkiness.
>
> Just think about the nuisance of finding adequate translations in
> i18n: "Woaßnet", "Eh?", "Chepas" etc.
>
Well, that won't be a problem, as commands and their subcommands and
options aren't translated.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: git blame crashes with internal error
From: Björn Steinbrink @ 2007-10-14 15:23 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: gitster, git
In-Reply-To: <47122D02.9060204@op5.se>
On 2007.10.14 16:51:46 +0200, Andreas Ericsson wrote:
> Björn Steinbrink wrote:
>> I tried all git releases from 1.5.3 to 1.5.3.4 as well as the current
>> master and all of them crashed. A small shell script to reproduce the
>> problem is attached.
>
> Manual bisect? Ugh. This *is* the century of the competent developer
> tools, you know... ;-)
Then, how do I search for a good version with git bisect if I only have
the one data-point "master is bad"?
All I tried when testing those 5 versions was trying to find a good
version so that I can actually do an automatic bisect. And I stopped at
1.5.3 because I figured that my test-case is probably just pretty
uncommon and was basically always broken.
Another manual "bisect" shows that 1.5.0 also crashes and as 1.4.0
doesn't even want to read my git git repository, I don't intend to go
even further backwards in the history to find a good commit, unless
someone tells me that it is a really good idea or how to automate
finding a good commit in a sane way.
Björn
^ permalink raw reply
* Re: [PATCH 5/7] Bisect: factorise some logging into "bisect_write".
From: Johannes Schindelin @ 2007-10-14 16:07 UTC (permalink / raw)
To: Christian Couder; +Cc: Junio Hamano, git
In-Reply-To: <20071014142948.9f08b8ed.chriscool@tuxfamily.org>
Hi,
On Sun, 14 Oct 2007, Christian Couder wrote:
> diff --git a/git-bisect.sh b/git-bisect.sh
> index 847250c..e12125f 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -132,6 +131,7 @@ bisect_write() {
> esac
> echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
> echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
> + test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
> }
Isn't a nolog="$3" missing from bisect_write()?
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: René Scharfe @ 2007-10-14 16:13 UTC (permalink / raw)
To: Christian Couder
Cc: David Kastrup, Wincent Colaiuta, Junio Hamano,
Johannes Schindelin, git
In-Reply-To: <200710141709.51579.chriscool@tuxfamily.org>
Christian Couder schrieb:
> Le dimanche 14 octobre 2007, David Kastrup a écrit :
>> Wincent Colaiuta <win@wincent.com> writes:
>>> El 14/10/2007, a las 14:28, Christian Couder escribió:
>>>> Here is my bisect dunno patch series again.
>>> Good work on the series, Christian, but don't you think that
>>> "unknown" would sound a little bit better than "dunno"? For people
>>> who don't speak English as a second language "dunno" might not be
>>> immediately clear.
>> "undecided"?
>
> I choosed "dunno" because that was what Dscho suggested in this thread:
>
> http://thread.gmane.org/gmane.comp.version-control.git/53584/focus=53595
>
> It seems to me short and understandable at the same time.
>
> More meaningfull would be "untestable" or "cannottest" or "canttest" but
> it's much longer, while "good" and "bad" are short.
Ugly? Neutral?
René
^ permalink raw reply
* Re: [PATCH 6/7] Bisect: factorise "bisect_{bad,good,dunno}" into "bisect_state".
From: Johannes Schindelin @ 2007-10-14 16:15 UTC (permalink / raw)
To: Christian Couder; +Cc: Junio Hamano, git
In-Reply-To: <20071014143003.23ae649f.chriscool@tuxfamily.org>
Hi,
On Sun, 14 Oct 2007, Christian Couder wrote:
> -bisect_bad() {
> +bisect_state() {
> bisect_autostart
> - case "$#" in
> - 0)
> - rev=$(git rev-parse --verify HEAD) ;;
> - 1)
> - rev=$(git rev-parse --verify "$1^{commit}") ;;
> + state=$1
> + case "$#,$state" in
> + 0,*)
> + die "Please call 'bisect_state' with at least one argument." ;;
> + 1,bad|1,good|1,dunno)
> + rev=$(git rev-parse --verify HEAD) ||
> + die "Bad rev input: HEAD"
> + bisect_write "$state" "$rev" ;;
> + 2,bad)
> + rev=$(git rev-parse --verify "$2^{commit}") ||
> + die "Bad rev input: $2"
> + bisect_write "$state" "$rev" ;;
Really? As far as I see, "2,bad" is an error in the current bisect.
> @@ -404,17 +390,15 @@ bisect_run () {
> exit $res
> fi
>
> - # Use "bisect_good" or "bisect_bad"
> - # depending on run success or failure.
> + # Find current state depending on run success or failure.
> if [ $res -gt 0 ]; then
> - next_bisect='bisect_bad'
> + state='bad'
> else
> - next_bisect='bisect_good'
> + state='good'
> fi
Maybe it is time to have a special exit status for "dunno"? But this is
not something to fix in your patch, just an idea for a future patch.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: Johannes Schindelin @ 2007-10-14 16:16 UTC (permalink / raw)
To: Christian Couder; +Cc: Junio Hamano, git
In-Reply-To: <20071014142826.8caa0a9f.chriscool@tuxfamily.org>
Hi,
On Sun, 14 Oct 2007, Christian Couder wrote:
> Here is my bisect dunno patch series again.
> The changes since last time are the following:
>
> [PATCH 1/7] rev-list: implement --bisect-all
> [PATCH 2/7] Bisect: fix some white spaces and empty lines breakages.
>
> -> No change.
>
> [PATCH 3/7] Bisect: implement "bisect dunno" to mark untestable revisions.
>
> -> Added dunno stuff in "bisect_replay" that I had forgotten.
> -> Use "bisect_write_good" and "bisect_write_bad" in "bisect_replay"
> while at it.
>
> [PATCH 4/7] Bisect: factorise "bisect_write_*" functions.
> [PATCH 5/7] Bisect: factorise some logging into "bisect_write".
> [PATCH 6/7] Bisect: factorise "bisect_{bad,good,dunno}" into "bisect_state".
>
> -> Some new factorisation and clean up work.
>
> [PATCH 7/7] Bisect: add "bisect dunno" to the documentation.
>
> -> Document "bisect dunno" and fix some short usage descriptions.
Thanks for doing this. I think that especially the factorisation adds
tremendously to the readibility.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: David Kastrup @ 2007-10-14 16:25 UTC (permalink / raw)
To: René Scharfe
Cc: Christian Couder, Wincent Colaiuta, Junio Hamano,
Johannes Schindelin, git
In-Reply-To: <4712400C.2080900@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> Christian Couder schrieb:
>>
>> I choosed "dunno" because that was what Dscho suggested in this thread:
>>
>> http://thread.gmane.org/gmane.comp.version-control.git/53584/focus=53595
>>
>> It seems to me short and understandable at the same time.
>>
>> More meaningfull would be "untestable" or "cannottest" or
>> "canttest" but it's much longer, while "good" and "bad" are short.
>
> Ugly? Neutral?
"Ugly" has a certain charm to it but would probably not translate
well. "Limbo" would be another such candidate, probably with better
translatability. But while some of those have some geeky appeal, I
really think something reasonably plain like "undecided" would be
better in the long run.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply
* Re: [PATCH] Simplify usage string printing
From: Pierre Habouzit @ 2007-10-14 16:26 UTC (permalink / raw)
To: Jonas Fonseca; +Cc: git, Junio C Hamano
In-Reply-To: <20071014140116.GA20970@diku.dk>
[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]
On Sun, Oct 14, 2007 at 02:01:16PM +0000, Jonas Fonseca wrote:
> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
> ---
> builtin-branch.c | 1 -
> builtin-update-ref.c | 1 -
> parse-options.c | 2 +-
> 3 files changed, 1 insertions(+), 3 deletions(-)
>
> Pierre Habouzit <madcoder@debian.org> wrote Sat, Oct 13, 2007:
> > Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> > ---
> > builtin-update-ref.c | 71 +++++++++++++++++++++-----------------------------
> > 1 files changed, 30 insertions(+), 41 deletions(-)
> >
> > diff --git a/builtin-update-ref.c b/builtin-update-ref.c
> > index fe1f74c..eafb642 100644
> > --- a/builtin-update-ref.c
> > +++ b/builtin-update-ref.c
> > @@ -1,59 +1,48 @@
> > #include "cache.h"
> > #include "refs.h"
> > #include "builtin.h"
> > +#include "parse-options.h"
> >
> > -static const char git_update_ref_usage[] =
> > -"git-update-ref [-m <reason>] (-d <refname> <value> | [--no-deref] <refname> <value> [<oldval>])";
> > +static const char * const git_update_ref_usage[] = {
> > + "",
> > + "git-update-ref [options] -d <refname> <oldval>",
> > + "git-update-ref [options] <refname> <newval> [<oldval>]",
> > + NULL
> > +};
>
> How about something like this to get rid of these empty strings
> that look strange?
>
> > ./git update-ref -h
> usage: git-update-ref [options] -d <refname> <oldval>
> or: git-update-ref [options] <refname> <newval> [<oldval>]
I like the idea, though we may want to have more text to explain some
things about the command, so I'll do something in between that uses or:
until an empty line is met, and just prefix the result with four spaces
else, this way we can have:
usage: git-foo ...
or: git-foo ...
Did you know that you can do bar with git-foo ?
but beware that it cannot do quux.
-m <reason> reason of the update
-d deletes the reference
--no-deref update <refname> not the one it points to
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] Update manpages to reflect new short and long option aliases
From: Pierre Habouzit @ 2007-10-14 16:26 UTC (permalink / raw)
To: Jonas Fonseca; +Cc: git, Junio C Hamano
In-Reply-To: <20071014141042.GA21197@diku.dk>
[-- Attachment #1: Type: text/plain, Size: 198 bytes --]
added and pushed.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 0/7] Bisect dunno
From: Wincent Colaiuta @ 2007-10-14 16:35 UTC (permalink / raw)
To: David Kastrup
Cc: René Scharfe, Christian Couder, Junio Hamano,
Johannes Schindelin, git
In-Reply-To: <85y7e5ll38.fsf@lola.goethe.zz>
El 14/10/2007, a las 18:25, David Kastrup escribió:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>
>> Christian Couder schrieb:
>>>
>>> I choosed "dunno" because that was what Dscho suggested in this
>>> thread:
>>>
>>> http://thread.gmane.org/gmane.comp.version-control.git/53584/
>>> focus=53595
>>>
>>> It seems to me short and understandable at the same time.
>>>
>>> More meaningfull would be "untestable" or "cannottest" or
>>> "canttest" but it's much longer, while "good" and "bad" are short.
>>
>> Ugly? Neutral?
>
> "Ugly" has a certain charm to it but would probably not translate
> well. "Limbo" would be another such candidate, probably with better
> translatability. But while some of those have some geeky appeal, I
> really think something reasonably plain like "undecided" would be
> better in the long run.
"undecided" sounds good to me. It should be clear to non-native
speakers of English (at least, clearer than "dunno").
<personal opinion>
Another problem with "dunno" is that it might come across as a bit
unprofessional due to its informality. Yes, you'll find it in most
dictionaries, but always with a qualifier of "slang", "colloquial",
"casual", "pronunciation spelling" or similar.
</personal opinion>
Cheers,
Wincent
^ permalink raw reply
* Re: git blame crashes with internal error
From: Alex Riesen @ 2007-10-14 16:37 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: gitster, git
In-Reply-To: <20071014143628.GA22568@atjola.homenet>
Björn Steinbrink, Sun, Oct 14, 2007 16:36:28 +0200:
> Hi Junio,
>
> git blame just decided to crash on me, when I tried to use it while
> resolving a merge conflict. Interesting is probably, that it crashes
> when given the filename of a file that is not _directly_ affected by the
> merge, but contains code that originates from a file that caused
> conlicts.
>
> Error message is:
> fatal: internal error: ce_mode is 0
>
It is not crashing. It is just not handling unexpected situation
properly:
$ testcase.sh
...
Switched to branch "foo"
CONFLICT (delete/modify): file1 deleted in HEAD and modified in master. Version master of file1 left in tree.
Automatic merge failed; fix conflicts and then commit the result.
fatal: internal error: ce_mode is 0
$ git ls-files --cached --stage
100644 72139f38953679bd19b3a7938c479d73c1aa7b59 1 file1
100644 3181f904ce3f9364b08524edd262a7a2ac766c9c 3 file1
100644 24e1ea80d6dcc497f60597b2a6d7cf65ecaa958a 0 file2
See? There is an unresolved merge.
The question is, what's the problem...
^ permalink raw reply
* Re: Imports without Tariffs
From: Jeff King @ 2007-10-14 16:40 UTC (permalink / raw)
To: Michael Witten; +Cc: git
In-Reply-To: <814D00AE-B89A-45ED-A500-4643C825D0EB@mit.edu>
On Sat, Oct 13, 2007 at 07:04:52PM -0400, Michael Witten wrote:
> I can make a patch, but at the moment I'm swamped and I don't want to think
> about doing that.
>
> I'll get around to it eventually, I hope.
>
> Do I just submit the patch to this list? How do I know it will be used?
Yes, send a patch to the list and to Junio (the maintainer). See
Documentation/SubmittingPatches for details.
> Frankly, I don't know how robust my idea is either, but it's simple
> enough not to have many problems lurking in the shadows.
>
> It would certainly be more useful than not.
Then submit a patch implementing it. :)
>> all of the data that goes into the commit hash as textual comments in
>> the CVS commit (committer name/time, author name/time). And then
> I considered this too, but this exposes what we're doing. We don't
> want the old farts to wonder what all these hash thingies are.
Heh. I like the idea of git secretly infiltrating institutions,
replacing CVS unbeknownst to management. It was the same for Linux in
the mid-90's ("our mail server is running on what!?").
-Peff
^ permalink raw reply
* Re: git blame crashes with internal error
From: Pierre Habouzit @ 2007-10-14 16:50 UTC (permalink / raw)
To: David Kastrup; +Cc: Andreas Ericsson, Björn Steinbrink, gitster, git
In-Reply-To: <85hcktn3s0.fsf@lola.goethe.zz>
[-- Attachment #1: Type: text/plain, Size: 757 bytes --]
On Sun, Oct 14, 2007 at 02:56:31PM +0000, David Kastrup wrote:
> Andreas Ericsson <ae@op5.se> writes:
>
> > Björn Steinbrink wrote:
> >>
> >> I tried all git releases from 1.5.3 to 1.5.3.4 as well as the current
> >> master and all of them crashed. A small shell script to reproduce the
> >> problem is attached.
> >>
> >
> > Manual bisect? Ugh. This *is* the century of the competent developer
> > tools, you know... ;-)
>
> It's not a "bisect" when it crashes in all versions.
What What, git cannot bisect future versions ??? *g* what a
disappointment.
--
·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] parse-options: Allow abbreviated options when unambiguous
From: Johannes Schindelin @ 2007-10-14 16:54 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: Eric Wong, git
In-Reply-To: <20071014095755.GF1198@artemis.corp>
When there is an option "--amend", the option parser now recognizes
"--am" for that option, provided that there is no other option beginning
with "--am".
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
On Sun, 14 Oct 2007, Pierre Habouzit wrote:
> On Sun, Oct 14, 2007 at 09:18:55AM +0000, Eric Wong wrote:
> >
> > One feature I really like is automatically handling of long
> > option abbreviations. gitopt supported this at the expense of
> > complexity and the aforementioned intrusivenes. This allows
> > automatic handling of the abbreviation style seen commonly in
> > git shell scripts:
> >
> > --a|--am|--ame|--amen|--amend) (from git-commit.sh)
>
> Yes, but if you do that, you can't order options in the order
> you want (because of first match issues), making the help dumps
> hopelessly random.
I think this patch proves that you do not need to order the options...
;-)
parse-options.c | 32 ++++++++++++++++++++++++++++++++
t/t0040-parse-options.sh | 22 ++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index 72656a8..afc6c89 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -102,6 +102,13 @@ static int parse_short_opt(struct optparse_t *p, const struct option *options)
static int parse_long_opt(struct optparse_t *p, const char *arg,
const struct option *options)
{
+ const char *arg_end = strchr(arg, '=');
+ const struct option *abbrev_option = NULL;
+ int abbrev_flags = 0;
+
+ if (!arg_end)
+ arg_end = arg + strlen(arg);
+
for (; options->type != OPTION_END; options++) {
const char *rest;
int flags = 0;
@@ -111,10 +118,33 @@ static int parse_long_opt(struct optparse_t *p, const char *arg,
rest = skip_prefix(arg, options->long_name);
if (!rest) {
+ /* abbreviated? */
+ if (!strncmp(options->long_name, arg, arg_end - arg)) {
+is_abbreviated:
+ if (abbrev_option)
+ die ("Ambiguous option: %s "
+ "(could be --%s%s or --%s%s)",
+ arg,
+ (flags & OPT_UNSET) ?
+ "no-" : "",
+ options->long_name,
+ (abbrev_flags & OPT_UNSET) ?
+ "no-" : "",
+ abbrev_option->long_name);
+ if (!(flags & OPT_UNSET) && *arg_end)
+ p->opt = arg_end + 1;
+ abbrev_option = options;
+ abbrev_flags = flags;
+ continue;
+ }
+ /* negated? */
if (strncmp(arg, "no-", 3))
continue;
flags |= OPT_UNSET;
rest = skip_prefix(arg + 3, options->long_name);
+ /* abbreviated and negated? */
+ if (!rest && !prefixcmp(options->long_name, arg + 3))
+ goto is_abbreviated;
if (!rest)
continue;
}
@@ -125,6 +155,8 @@ static int parse_long_opt(struct optparse_t *p, const char *arg,
}
return get_value(p, options, flags);
}
+ if (abbrev_option)
+ return get_value(p, abbrev_option, abbrev_flags);
return error("unknown option `%s'", arg);
}
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index 09b3230..e4dd86f 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -66,4 +66,26 @@ test_expect_success 'intermingled arguments' '
git diff expect output
'
+cat > expect << EOF
+boolean: 0
+integer: 2
+string: (not set)
+EOF
+
+test_expect_success 'unambiguously abbreviated option' '
+ test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
+ test ! -s output.err &&
+ git diff expect output
+'
+
+test_expect_success 'unambiguously abbreviated option with "="' '
+ test-parse-options --int=2 > output 2> output.err &&
+ test ! -s output.err &&
+ git diff expect output
+'
+
+test_expect_failure 'ambiguously abbreviated option' '
+ test-parse-options --strin 123
+'
+
test_done
--
1.5.3.4.1174.gcd0d6-dirty
^ permalink raw reply related
* [PATCH amend 08/14] Add infrastructure to run a function asynchronously.
From: Johannes Sixt @ 2007-10-14 17:08 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <1192305984-22594-9-git-send-email-johannes.sixt@telecom.at>
This adds start_async() and finish_async(), which runs a function
asynchronously. Communication with the caller happens only via pipes.
For this reason, this implementation forks off a child process that runs
the function.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
This is the same as submitted previously except it uses close_pair()
to close the pipe in an error patch and improves the comments in
run-command.h.
-- Hannes
run-command.c | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
run-command.h | 22 ++++++++++++++++++++++
2 files changed, 66 insertions(+), 8 deletions(-)
diff --git a/run-command.c b/run-command.c
index d00c03b..db02f75 100644
--- a/run-command.c
+++ b/run-command.c
@@ -127,16 +127,11 @@ int start_command(struct child_process *cmd)
return 0;
}
-int finish_command(struct child_process *cmd)
+static int wait_or_whine(pid_t pid)
{
- if (cmd->close_in)
- close(cmd->in);
- if (cmd->close_out)
- close(cmd->out);
-
for (;;) {
int status, code;
- pid_t waiting = waitpid(cmd->pid, &status, 0);
+ pid_t waiting = waitpid(pid, &status, 0);
if (waiting < 0) {
if (errno == EINTR)
@@ -144,7 +139,7 @@ int finish_command(struct child_process *cmd)
error("waitpid failed (%s)", strerror(errno));
return -ERR_RUN_COMMAND_WAITPID;
}
- if (waiting != cmd->pid)
+ if (waiting != pid)
return -ERR_RUN_COMMAND_WAITPID_WRONG_PID;
if (WIFSIGNALED(status))
return -ERR_RUN_COMMAND_WAITPID_SIGNAL;
@@ -158,6 +153,15 @@ int finish_command(struct child_process *cmd)
}
}
+int finish_command(struct child_process *cmd)
+{
+ if (cmd->close_in)
+ close(cmd->in);
+ if (cmd->close_out)
+ close(cmd->out);
+ return wait_or_whine(cmd->pid);
+}
+
int run_command(struct child_process *cmd)
{
int code = start_command(cmd);
@@ -200,3 +204,35 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
cmd.env = env;
return run_command(&cmd);
}
+
+int start_async(struct async *async)
+{
+ int pipe_out[2];
+
+ if (pipe(pipe_out) < 0) {
+ return error("cannot create pipe: %s", strerror(errno));
+ }
+
+ async->pid = fork();
+ if (async->pid < 0) {
+ error("fork (async) failed: %s", strerror(errno));
+ close_pair(pipe_out);
+ return -1;
+ }
+ if (!async->pid) {
+ close(pipe_out[0]);
+ exit(!!async->proc(pipe_out[1], async->data));
+ }
+ async->out = pipe_out[0];
+ close(pipe_out[1]);
+ return 0;
+}
+
+int finish_async(struct async *async)
+{
+ int ret = 0;
+
+ if (wait_or_whine(async->pid))
+ ret = error("waitpid (async) failed");
+ return ret;
+}
diff --git a/run-command.h b/run-command.h
index 35b9fb6..94e1e9d 100644
--- a/run-command.h
+++ b/run-command.h
@@ -43,4 +43,26 @@ int run_command_v_opt_cd(const char **argv, int opt, const char *dir);
*/
int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const char *const *env);
+/*
+ * The purpose of the following functions is to feed a pipe by running
+ * a function asynchronously and providing output that the caller reads.
+ *
+ * It is expected that no synchronization and mutual exclusion between
+ * the caller and the feed function is necessary so that the function
+ * can run in a thread without interfering with the caller.
+ */
+struct async {
+ /*
+ * proc writes to fd and closes it;
+ * returns 0 on success, non-zero on failure
+ */
+ int (*proc)(int fd, void *data);
+ void *data;
+ int out; /* caller reads from here and closes it */
+ pid_t pid;
+};
+
+int start_async(struct async *async);
+int finish_async(struct async *async);
+
#endif
--
1.5.3.2.141.g48f10
^ permalink raw reply related
* Re: [PATCH 0/14] fork/exec removal series
From: Johannes Schindelin @ 2007-10-14 17:09 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: Shawn O. Pearce, Johannes Sixt, gitster, git
In-Reply-To: <20071014071239.GB1198@artemis.corp>
Hi,
On Sun, 14 Oct 2007, Pierre Habouzit wrote:
> On Sun, Oct 14, 2007 at 02:58:57AM +0000, Shawn O. Pearce wrote:
>
> > But we most definately *must* continue to support fork() for the async
> > functions. Its the most common interface available on one of our
> > biggest platforms (UNIX).
>
> Yeah that, and the fact that many of the git modules aren't thread-safe
> (some modules have static buffers strbuf's or caching variables) and
> should be used with care.
I think that was exactly the point of Shawn: expose bugs on Unix that
would otherwise only show in msysGit.
Ciao,
Dscho
^ permalink raw reply
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