* notice: pu broken tonight
@ 2009-06-09 8:36 Junio C Hamano
2009-06-09 17:11 ` René Scharfe
2009-06-10 7:44 ` Uwe Kleine-König
0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2009-06-09 8:36 UTC (permalink / raw)
To: git
I've queued a handful of patches from yesterday on maint and master,
advanced sp/msysgit topic to next, and queued the remaining new patches
along with the old topics on pu.
I added "just in case output from strerror() had % in it" patch to
tr/die_errno topic when I queued it, but I didn't look at the conversion
from die() to die_errno().
Also I didn't queue the show-branch default_arg patch. Other than that I
do not think I forgot to queue any patch I saw on the list.
I usually make sure all four branches pass the tests before pushing them
out, but in tonight's integration, the tip of 'pu' does not pass test for
me, hence this notice.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: notice: pu broken tonight
2009-06-09 8:36 notice: pu broken tonight Junio C Hamano
@ 2009-06-09 17:11 ` René Scharfe
2009-06-10 7:44 ` Uwe Kleine-König
1 sibling, 0 replies; 10+ messages in thread
From: René Scharfe @ 2009-06-09 17:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano schrieb:
> I usually make sure all four branches pass the tests before pushing them
> out, but in tonight's integration, the tip of 'pu' does not pass test for
> me, hence this notice.
The following patch makes the tests pass again for me. Feel free to squash
it into 10c29915.
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 2d36f78..25029a9 100644
--- a/Makefile
+++ b/Makefile
@@ -921,7 +921,7 @@ SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|'
PATH := $(SANE_TOOL_PATH):${PATH}
else
-BROKEN_PATH_FIX = d
+BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
endif
ifeq ($(uname_S),Darwin)
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: notice: pu broken tonight
2009-06-09 8:36 notice: pu broken tonight Junio C Hamano
2009-06-09 17:11 ` René Scharfe
@ 2009-06-10 7:44 ` Uwe Kleine-König
2009-06-10 7:56 ` Junio C Hamano
1 sibling, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-10 7:44 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Hello Junio,
On Tue, Jun 09, 2009 at 01:36:20AM -0700, Junio C Hamano wrote:
> Other than that I
> do not think I forgot to queue any patch I saw on the list.
What about
http://news.gmane.org/find-root.php?group=gmane.comp.version-control.git&article=120990
? I think it's save, but I didn't get any feed-back by you yet. (And I
won't believe you when you say you didn't see it, because you took
http://news.gmane.org/find-root.php?group=gmane.comp.version-control.git&article=117807
from the same thread. :-))
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: notice: pu broken tonight
2009-06-10 7:44 ` Uwe Kleine-König
@ 2009-06-10 7:56 ` Junio C Hamano
2009-06-10 9:42 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Uwe Kleine-König
0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2009-06-10 7:56 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: git
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> Hello Junio,
>
> On Tue, Jun 09, 2009 at 01:36:20AM -0700, Junio C Hamano wrote:
>> Other than that I
>> do not think I forgot to queue any patch I saw on the list.
> What about
>
> http://news.gmane.org/find-root.php?group=gmane.comp.version-control.git&article=120990
> ? I think it's save, but I didn't get any feed-back by you yet.
Nor anybody else for that matter ;-).
A patch that adds a new feature to a low-level building block without any
in-tree users, especially if there is no test for it, ranks very low in
the priority scale when I am short of time.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] more tests for git rev-parse --parse-opt
2009-06-10 7:56 ` Junio C Hamano
@ 2009-06-10 9:42 ` Uwe Kleine-König
2009-06-10 9:42 ` [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse Uwe Kleine-König
2009-06-10 10:37 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Johannes Sixt
0 siblings, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-10 9:42 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,
I'm not completely sure that it's portable to use input redirection and
&& together---at least it looks a bit ugly. Probably you know better.
Best regards
Uwe
t/t1502-rev-parse-parseopt.sh | 48 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index 997002d..081812b 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -20,8 +20,7 @@ Extras
EOF
-test_expect_success 'test --parseopt help output' '
- git rev-parse --parseopt -- -h 2> output.err <<EOF
+OPTION_SPEC="\
some-command [options] <args>...
some-command does foo and bar!
@@ -36,8 +35,53 @@ C? option C with an optional argument
Extras
extra1 line above used to cause a segfault but no longer does
+"
+
+test_expect_success 'test --parseopt help output' '
+ git rev-parse --parseopt -- -h 2> output.err <<EOF
+$OPTION_SPEC
EOF
test_cmp expect.err output.err
'
+cat > expect <<EOF
+set -- --foo --bar 'ham' -- 'arg'
+EOF
+
+test_expect_success 'test --parseopt' '
+ git rev-parse --parseopt -- --foo --bar=ham arg << EOF > output &&
+$OPTION_SPEC
+EOF
+ test_cmp expect output
+'
+
+test_expect_success 'test --parseopt with mixed options and arguments' '
+ git rev-parse --parseopt -- --foo arg --bar=ham << EOF > output &&
+$OPTION_SPEC
+EOF
+ test_cmp expect output
+'
+
+cat > expect <<EOF
+set -- --foo -- 'arg' '--bar=ham'
+EOF
+
+test_expect_success 'test --parseopt with --' '
+ git rev-parse --parseopt -- --foo -- arg --bar=ham << EOF > output &&
+$OPTION_SPEC
+EOF
+ test_cmp expect output
+'
+
+cat > expect <<EOF
+set -- --foo -- '--' 'arg' '--bar=ham'
+EOF
+
+test_expect_success 'test --parseopt --keep-dashdash' '
+ git rev-parse --parseopt --keep-dashdash -- --foo -- arg --bar=ham << EOF > output &&
+$OPTION_SPEC
+EOF
+ test_cmp expect output
+'
+
test_done
--
1.6.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse
2009-06-10 9:42 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Uwe Kleine-König
@ 2009-06-10 9:42 ` Uwe Kleine-König
2009-06-10 10:37 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Johannes Sixt
1 sibling, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-10 9:42 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hi Junio,
> Nor anybody else for that matter ;-).
I just didn't want to upset Peff as he answered to my inital patch.
> A patch that adds a new feature to a low-level building block without any
> in-tree users, especially if there is no test for it, ranks very low in
> the priority scale when I am short of time.
OK for me. While waiting for you to have more time I added a few tests,
for the new and old code. :-)
Best regards
Uwe
Documentation/git-rev-parse.txt | 5 +++++
builtin-rev-parse.c | 8 ++++++--
t/t1502-rev-parse-parseopt.sh | 7 +++++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 4bbdd05..82045a2 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -30,6 +30,11 @@ OPTIONS
Only meaningful in `--parseopt` mode. Tells the option parser to echo
out the first `--` met instead of skipping it.
+--stop-at-non-option::
+ Only meaningful in `--parseopt` mode. Lets the option parser stop at
+ the first non-option argument. This can be used to parse sub-commands
+ that take options themself.
+
--sq-quote::
Use 'git-rev-parse' in shell quoting mode (see SQ-QUOTE
section below). In contrast to the `--sq` option below, this
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 112d622..5ea7518 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -301,7 +301,7 @@ static const char *skipspaces(const char *s)
static int cmd_parseopt(int argc, const char **argv, const char *prefix)
{
- static int keep_dashdash = 0;
+ static int keep_dashdash = 0, stop_at_non_option = 0;
static char const * const parseopt_usage[] = {
"git rev-parse --parseopt [options] -- [<args>...]",
NULL
@@ -309,6 +309,9 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
static struct option parseopt_opts[] = {
OPT_BOOLEAN(0, "keep-dashdash", &keep_dashdash,
"keep the `--` passed as an arg"),
+ OPT_BOOLEAN(0, "stop-at-non-option", &stop_at_non_option,
+ "stop parsing after the "
+ "first non-option argument"),
OPT_END(),
};
@@ -394,7 +397,8 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
ALLOC_GROW(opts, onb + 1, osz);
memset(opts + onb, 0, sizeof(opts[onb]));
argc = parse_options(argc, argv, prefix, opts, usage,
- keep_dashdash ? PARSE_OPT_KEEP_DASHDASH : 0);
+ keep_dashdash ? PARSE_OPT_KEEP_DASHDASH : 0 |
+ stop_at_non_option ? PARSE_OPT_STOP_AT_NON_OPTION : 0);
strbuf_addf(&parsed, " --");
sq_quote_argv(&parsed, argv, 0);
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index 081812b..93f2cd1 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -73,6 +73,13 @@ EOF
test_cmp expect output
'
+test_expect_success 'test --parseopt --stop-at-non-option' '
+ git rev-parse --parseopt --stop-at-non-option -- --foo arg --bar=ham << EOF > output &&
+$OPTION_SPEC
+EOF
+ test_cmp expect output
+'
+
cat > expect <<EOF
set -- --foo -- '--' 'arg' '--bar=ham'
EOF
--
1.6.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] more tests for git rev-parse --parse-opt
2009-06-10 9:42 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Uwe Kleine-König
2009-06-10 9:42 ` [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse Uwe Kleine-König
@ 2009-06-10 10:37 ` Johannes Sixt
2009-06-10 14:16 ` Uwe Kleine-König
1 sibling, 1 reply; 10+ messages in thread
From: Johannes Sixt @ 2009-06-10 10:37 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: git, Junio C Hamano
Uwe Kleine-König schrieb:
> I'm not completely sure that it's portable to use input redirection and
> && together---at least it looks a bit ugly. Probably you know better.
The problem is more likely that there are shells that dislike heredocs in
eval'ed expressions. But we use such constructs already in other tests, so
it should not matter a lot. Since you are modifying the code anyway, you
can "do it right".
> -test_expect_success 'test --parseopt help output' '
> - git rev-parse --parseopt -- -h 2> output.err <<EOF
> +OPTION_SPEC="\
> some-command [options] <args>...
>
> some-command does foo and bar!
> @@ -36,8 +35,53 @@ C? option C with an optional argument
>
> Extras
> extra1 line above used to cause a segfault but no longer does
> +"
> +
> +test_expect_success 'test --parseopt help output' '
> + git rev-parse --parseopt -- -h 2> output.err <<EOF
> +$OPTION_SPEC
> EOF
> test_cmp expect.err output.err
> '
You use the same input in this and all new tests; make this:
cat > optionspec <<EOF
...
EOF
test_expect_success 'test --parseopt help output' '
git rev-parse --parseopt -- -h 2> output.err < optionspec &&
test_cmp expect.err output.err
(note the added &&).
-- Hannes
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] more tests for git rev-parse --parse-opt
2009-06-10 10:37 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Johannes Sixt
@ 2009-06-10 14:16 ` Uwe Kleine-König
2009-06-13 23:58 ` Uwe Kleine-König
0 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-10 14:16 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, Junio C Hamano
Hello Johannes,
On Wed, Jun 10, 2009 at 12:37:32PM +0200, Johannes Sixt wrote:
> Uwe Kleine-König schrieb:
> > -test_expect_success 'test --parseopt help output' '
> > - git rev-parse --parseopt -- -h 2> output.err <<EOF
> > +OPTION_SPEC="\
> > some-command [options] <args>...
> >
> > some-command does foo and bar!
> > @@ -36,8 +35,53 @@ C? option C with an optional argument
> >
> > Extras
> > extra1 line above used to cause a segfault but no longer does
> > +"
> > +
> > +test_expect_success 'test --parseopt help output' '
> > + git rev-parse --parseopt -- -h 2> output.err <<EOF
> > +$OPTION_SPEC
> > EOF
> > test_cmp expect.err output.err
> > '
>
> You use the same input in this and all new tests; make this:
>
> cat > optionspec <<EOF
> ...
> EOF
>
> test_expect_success 'test --parseopt help output' '
> git rev-parse --parseopt -- -h 2> output.err < optionspec &&
> test_cmp expect.err output.err
>
> (note the added &&).
OK, this should work. I will rework it later today.
BTW: I wonder why
git rev-parse --parseopt -- -h 2> output.err < optionspec
fills output.err, is there some magic that detects that the help should
be printed? *read some source* ah, -h is hardcoded to print the help.
This is a bit surprising, still more as -h is a valid option in the
specified optionspec. Thoughts?
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] more tests for git rev-parse --parse-opt
2009-06-10 14:16 ` Uwe Kleine-König
@ 2009-06-13 23:58 ` Uwe Kleine-König
2009-06-13 23:58 ` [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse Uwe Kleine-König
0 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-13 23:58 UTC (permalink / raw)
To: git
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
t/t1502-rev-parse-parseopt.sh | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index 997002d..be0959e 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -20,8 +20,7 @@ Extras
EOF
-test_expect_success 'test --parseopt help output' '
- git rev-parse --parseopt -- -h 2> output.err <<EOF
+cat > optionspec << EOF
some-command [options] <args>...
some-command does foo and bar!
@@ -37,7 +36,42 @@ C? option C with an optional argument
Extras
extra1 line above used to cause a segfault but no longer does
EOF
+
+test_expect_success 'test --parseopt help output' '
+ git rev-parse --parseopt -- -h 2> output.err < optionspec
test_cmp expect.err output.err
'
+cat > expect <<EOF
+set -- --foo --bar 'ham' -- 'arg'
+EOF
+
+test_expect_success 'test --parseopt' '
+ git rev-parse --parseopt -- --foo --bar=ham arg < optionspec > output &&
+ test_cmp expect output
+'
+
+test_expect_success 'test --parseopt with mixed options and arguments' '
+ git rev-parse --parseopt -- --foo arg --bar=ham < optionspec > output &&
+ test_cmp expect output
+'
+
+cat > expect <<EOF
+set -- --foo -- 'arg' '--bar=ham'
+EOF
+
+test_expect_success 'test --parseopt with --' '
+ git rev-parse --parseopt -- --foo -- arg --bar=ham < optionspec > output &&
+ test_cmp expect output
+'
+
+cat > expect <<EOF
+set -- --foo -- '--' 'arg' '--bar=ham'
+EOF
+
+test_expect_success 'test --parseopt --keep-dashdash' '
+ git rev-parse --parseopt --keep-dashdash -- --foo -- arg --bar=ham < optionspec > output &&
+ test_cmp expect output
+'
+
test_done
--
1.6.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse
2009-06-13 23:58 ` Uwe Kleine-König
@ 2009-06-13 23:58 ` Uwe Kleine-König
0 siblings, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2009-06-13 23:58 UTC (permalink / raw)
To: git
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Documentation/git-rev-parse.txt | 5 +++++
builtin-rev-parse.c | 8 ++++++--
t/t1502-rev-parse-parseopt.sh | 5 +++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 4bbdd05..82045a2 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -30,6 +30,11 @@ OPTIONS
Only meaningful in `--parseopt` mode. Tells the option parser to echo
out the first `--` met instead of skipping it.
+--stop-at-non-option::
+ Only meaningful in `--parseopt` mode. Lets the option parser stop at
+ the first non-option argument. This can be used to parse sub-commands
+ that take options themself.
+
--sq-quote::
Use 'git-rev-parse' in shell quoting mode (see SQ-QUOTE
section below). In contrast to the `--sq` option below, this
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 112d622..5ea7518 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -301,7 +301,7 @@ static const char *skipspaces(const char *s)
static int cmd_parseopt(int argc, const char **argv, const char *prefix)
{
- static int keep_dashdash = 0;
+ static int keep_dashdash = 0, stop_at_non_option = 0;
static char const * const parseopt_usage[] = {
"git rev-parse --parseopt [options] -- [<args>...]",
NULL
@@ -309,6 +309,9 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
static struct option parseopt_opts[] = {
OPT_BOOLEAN(0, "keep-dashdash", &keep_dashdash,
"keep the `--` passed as an arg"),
+ OPT_BOOLEAN(0, "stop-at-non-option", &stop_at_non_option,
+ "stop parsing after the "
+ "first non-option argument"),
OPT_END(),
};
@@ -394,7 +397,8 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
ALLOC_GROW(opts, onb + 1, osz);
memset(opts + onb, 0, sizeof(opts[onb]));
argc = parse_options(argc, argv, prefix, opts, usage,
- keep_dashdash ? PARSE_OPT_KEEP_DASHDASH : 0);
+ keep_dashdash ? PARSE_OPT_KEEP_DASHDASH : 0 |
+ stop_at_non_option ? PARSE_OPT_STOP_AT_NON_OPTION : 0);
strbuf_addf(&parsed, " --");
sq_quote_argv(&parsed, argv, 0);
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index be0959e..e504058 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -65,6 +65,11 @@ test_expect_success 'test --parseopt with --' '
test_cmp expect output
'
+test_expect_success 'test --parseopt --stop-at-non-option' '
+ git rev-parse --parseopt --stop-at-non-option -- --foo arg --bar=ham < optionspec > output &&
+ test_cmp expect output
+'
+
cat > expect <<EOF
set -- --foo -- '--' 'arg' '--bar=ham'
EOF
--
1.6.3.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-06-13 23:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09 8:36 notice: pu broken tonight Junio C Hamano
2009-06-09 17:11 ` René Scharfe
2009-06-10 7:44 ` Uwe Kleine-König
2009-06-10 7:56 ` Junio C Hamano
2009-06-10 9:42 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Uwe Kleine-König
2009-06-10 9:42 ` [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse Uwe Kleine-König
2009-06-10 10:37 ` [PATCH 1/2] more tests for git rev-parse --parse-opt Johannes Sixt
2009-06-10 14:16 ` Uwe Kleine-König
2009-06-13 23:58 ` Uwe Kleine-König
2009-06-13 23:58 ` [PATCH 2/2] parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse Uwe Kleine-König
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).