Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler
From: Petr Baudis @ 2006-06-25 15:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vk676orjy.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Sun, Jun 25, 2006 at 05:14:09AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Petr Baudis <pasky@suse.cz> writes:
> > This is not really meant for an application yet since it's not clear
> > if it will alone help anything.

It appears that it did have helped and all went well, according to dst_.

> I would question why the rest of git is not built with Sun CC as
> well if that is the case.

< dst_> Three points: (1) Gcc comes along with solaris, sun cc not.
< dst_> (2) Git used a lot of GCC'isms whan I last checked a few weeks ago
< dst_> (3) a lot of other software will not ompile out of the box with suncc, so gcc is usually the safer choice

Of course (1) is troublesome since this means you can't build Git on
Solaris without installing Sun CC - I have no other answer to this than
that Solaris is horribly broken. :-( Perhaps ExtUtils::MakeMaker could
be convinced to build with gcc, I'm not sure.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.

^ permalink raw reply

* [PATCH] git-grep: allow patterns starting with -
From: Matthias Lederhofer @ 2006-06-25 15:38 UTC (permalink / raw)
  To: git

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
I did not find another way to use patterns starting with -, if it is
possible without the patch please tell me and ignore the patch :)
example:
% git grep -- --bla HEAD HEAD~1 -- --foo
HEAD:--foo/bla:test --bla foo

 builtin-grep.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/builtin-grep.c b/builtin-grep.c
index 2e7986c..d0677cc 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -817,8 +817,13 @@ int cmd_grep(int argc, const char **argv
 			}
 			usage(builtin_grep_usage);
 		}
-		if (!strcmp("--", arg))
+		if (!strcmp("--", arg)) {
+			if (!opt.pattern_list && argc > 0) {
+				argc--; argv++;
+				add_pattern(&opt, *argv, "command line", 0);
+			}
 			break;
+		}
 		if (*arg == '-')
 			usage(builtin_grep_usage);
 
-- 
1.4.1.rc1.g29f4a-dirty

^ permalink raw reply related

* Re: On boolean configuration variables...
From: Anand Kumria @ 2006-06-25 15:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0606251553110.29667@wbgn013.biozentrum.uni-wuerzburg.de>

On Sun, Jun 25, 2006 at 04:00:34PM +0200, Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 25 Jun 2006, Anand Kumria wrote:
> 
> > Allowing 'yes' and 'no' to equal 'true' and 'false' respectively sounds
> > pretty sane and user-friendly.
> > 
> > Why wouldn't you want to do that?
> 
> 'Cause you'd have to add "maybe", too ;-)
> 
> Seriously, there is a subtle side to booleans, which is the reason that 
> they typically take on only "false" and "true": Consider the question "Is 
> the box not red?". If the answer is "yes", I do not know if "yes, the box 
> is red" or "yes, the box is not red".
> 
> "true" and "false" are less ambiguous.

"True, the box is red" and "true, the box is not red" are just as ambiguous.
It is always ambiguous if you allow a qualifier.

Cheers,
Anand

-- 
 `When any government, or any church for that matter, undertakes to say to
  its subjects, "This you may not read, this you must not see, this you are
  forbidden to know," the end result is tyranny and oppression no matter how
  holy the motives' -- Robert A Heinlein, "If this goes on --"

^ permalink raw reply

* Re: [PATCH] git-grep: allow patterns starting with -
From: Timo Hirvonen @ 2006-06-25 15:47 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: git
In-Reply-To: <E1FuWh7-0008Ry-HX@moooo.ath.cx>

Matthias Lederhofer <matled@gmx.net> wrote:

> Signed-off-by: Matthias Lederhofer <matled@gmx.net>
> ---
> I did not find another way to use patterns starting with -, if it is
> possible without the patch please tell me and ignore the patch :)
> example:
> % git grep -- --bla HEAD HEAD~1 -- --foo
> HEAD:--foo/bla:test --bla foo

git grep -e --bla

It's not very well documented.

-- 
http://onion.dynserv.net/~timo/

^ permalink raw reply

* [PATCH] correct documentation for git grep
From: Matthias Lederhofer @ 2006-06-25 16:07 UTC (permalink / raw)
  To: Timo Hirvonen; +Cc: git
In-Reply-To: <20060625184757.f8273820.tihirvon@gmail.com>

---
> git grep -e --bla
> 
> It's not very well documented.
Let's change that!

 Documentation/git-grep.txt |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 7b810df..62a8e7f 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -16,7 +16,7 @@ SYNOPSIS
 	   [-n] [-l | --files-with-matches] [-L | --files-without-match]
 	   [-c | --count]
 	   [-A <post-context>] [-B <pre-context>] [-C <context>]
-	   [-f <file>] [-e <pattern>]
+	   [-f <file>] [-e] <pattern>
 	   [<tree>...]
 	   [--] [<path>...]
 
@@ -71,6 +71,11 @@ OPTIONS
 -f <file>::
 	Read patterns from <file>, one per line.
 
+-e::
+	The next parameter is the pattern. This option has to be
+	used for patterns starting with - and should be used in
+	scripts passing user input to grep.
+
 `<tree>...`::
 	Search blobs in the trees for specified patterns.
 
-- 
1.4.1.rc1.gc594

^ permalink raw reply related

* Re: [PATCH] GIT_TRACE: show which built-in/external commands are executed
From: Matthias Lederhofer @ 2006-06-25 16:10 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0606251607090.29667@wbgn013.biozentrum.uni-wuerzburg.de>

> Hi,
> 
> On Sun, 25 Jun 2006, Matthias Lederhofer wrote:
> 
> > With the environment variable GIT_TRACE set git will show
> >  - alias expansion
> >  - built-in command execution
> >  - external command execution
> > on stderr.
> 
> Nice.
Thanks :)

> P.S.: Now we only have to convert all "git-" invocations in the scripts to
> "git " invocations so we can benefit from it. But that would mean two 
> forks instead of one for the non-builtins. Hmm.

Why do we not use this policy:

git-* is guaranteed to be the normal command without any strange alias
expansion, default parameters or something else a script does not like
to be changed in the commands. So all scripts use git-*, this will
prevent a double exec. The path to git-* should be obtained using git
--exec-path in the beginnig.

git <command> is to be used by the user if he wants aliases, default
parameters and other fancy stuff.

Using this policy the user can always get the normal behaviour and it
is possible to shadown built-in commands etc.

^ permalink raw reply

* Re: [PATCH] git-grep: allow patterns starting with -
From: Matthias Lederhofer @ 2006-06-25 16:18 UTC (permalink / raw)
  To: Timo Hirvonen; +Cc: git
In-Reply-To: <20060625184757.f8273820.tihirvon@gmail.com>

> Matthias Lederhofer <matled@gmx.net> wrote:
> 
> > Signed-off-by: Matthias Lederhofer <matled@gmx.net>
> > ---
> > I did not find another way to use patterns starting with -, if it is
> > possible without the patch please tell me and ignore the patch :)
> > example:
> > % git grep -- --bla HEAD HEAD~1 -- --foo
> > HEAD:--foo/bla:test --bla foo
> 
> git grep -e --bla
Perhaps the original patch may be applied anyways for consistency with
the GNU grep? :)
But it's really not important to me and well, having -- twice in the
command line is a bit strange too.

^ permalink raw reply

* Re: [RFC] GIT user survey
From: Sam Ravnborg @ 2006-06-25 16:20 UTC (permalink / raw)
  To: Paolo Ciarrocchi; +Cc: Martin Langhoff, Git Mailing List
In-Reply-To: <4d8e3fd30606250347o47c4b200t6feb0406bfa535fa@mail.gmail.com>

Hi
>    2. What is your preferred language?
You need to rephase this so it tell for what purpose.

	Sam

^ permalink raw reply

* Re: [RFC] git-fetch - repack in the background after fetching
From: Linus Torvalds @ 2006-06-25 17:29 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Martin Langhoff, git, junkio
In-Reply-To: <Pine.LNX.4.63.0606251122260.29667@wbgn013.biozentrum.uni-wuerzburg.de>



On Sun, 25 Jun 2006, Johannes Schindelin wrote:
> 
> On Sat, 24 Jun 2006, Linus Torvalds wrote:
> 
> > However, the more worrisome thing about background repacking is that while 
> > it should be safe against normal users, if you have two _repacks_ at the 
> > same time, they can decide to remove each others packs. Yeah, yeah, that's 
> > pretty damn unlikely, but hey, "pretty damn unlikely" is not "impossible".
> 
> Why not introduce a lock file for repack?

You can do that. The problem is, lock-files are really hard to do 
right, and portably. Especially from scripts.

But _I_ think the basic issue is that it's wrong to even try to do this 
background repack.

Git does explicit repacking. That's just how it is. If the worry is that 
people forget to pack often enough, why not just have the "git pull" 
script _tell_ the user, something like

	if [lots of unpacked objects]; then
		echo "You've got a boatload of unpacked objects now."
		echo "Maybe you'd like to repack using"
		echo "   git repack -a -d"
		echo "Thank you for not smoking"
	fi >&2

which is educational on so many levels.

		Linus

^ permalink raw reply

* Re: What's in git.git
From: Linus Torvalds @ 2006-06-25 17:47 UTC (permalink / raw)
  To: Junio C Hamano, Timo Hirvonen; +Cc: Git Mailing List
In-Reply-To: <7v7j35wp84.fsf@assigned-by-dhcp.cox.net>



On Sun, 25 Jun 2006, Junio C Hamano wrote:
> 
>    Timo Hirvonen:
>       Clean up diff.c

THIS IS CRAP!

Dammit, anybody who claims that casting a constant string to "(char *)" is 
a _cleanup_ is doing something seriously wrong.

That's crap, crap, crap, CRAP!

If the "cleanup" was about hiding compiler warnings, then dammit, those 
warnings should be fixed by fixing the code, not by casting the warning 
away but leaving the broken code.

If the ptr really is never accessed, and doesn't matter, then don't use a 
constant empty string, use NULL.

And if it _is_ accessed, then casting a constant string to "char *" is 
_wrong_. 

The whole and only point about the "const" warnings is not to hide them, 
but to fix the code. If you're not going to fix the code, then you 
shouldn't ask the compiler to warn about it, it's that simple. Adding 
bogus casts is not the answer.

I really hate how many _bogus_ casts we're growing. Casts are one of the 
most important features of C (it's what allows you to break the type 
system if you need to, and turns C into the truly extensible language it 
is), but they should be used with reverence and care, not to shut up a 
compiler.

I'm _especially_ disgusted by how this was claimed to be a "cleanup". 
Adding a cast is _never_ a cleanup.

Dammit, don't do crap like this!

THIS is a cleanup:

-               char *prefix = "";
+               const char *prefix = "";

but THESE are total and utter CRAP:

-               mf->ptr = ""; /* does not matter */
+               mf->ptr = (char *)""; /* does not matter */
-                               s->data = "";
+                               s->data = (char *)"";

and we're better off with the warning than with the new code.

I suspect that both could have been made to use NULL instead to indicate 
that no pointer exists.

			Linus

^ permalink raw reply

* Re: [RFC] git-fetch - repack in the background after fetching
From: linux @ 2006-06-25 17:53 UTC (permalink / raw)
  To: git

How about a post-fetch hook script that can do this?  With an example
of either printing a message or repacking in the background?

procmail includes a lockfile(1) utility useful for shell scripts, but
it also wouldn't be hard to add a "git-lock-file <file> <command>..."
utility that would create the given lock file, fork the command, and
clean up again when it exited, relaying its exit status.
(I can write one if there's interest.)

I agree with Linus that *defaulting* to background repack has problems,
but it does seem useful to provide enough hooks to easily implement
the option.  Even printing the warning in a script seems like it would
simplify internationalization, and different sites (e.g. reiserfs
developers) might have different policies about what constitutes
"a boatload".

^ permalink raw reply

* Re: What's in git.git
From: Timo Hirvonen @ 2006-06-25 18:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: junkio, git
In-Reply-To: <Pine.LNX.4.64.0606251033030.3747@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> wrote:

> On Sun, 25 Jun 2006, Junio C Hamano wrote:
> > 
> >    Timo Hirvonen:
> >       Clean up diff.c
> 
> THIS IS CRAP!
> 
> Dammit, anybody who claims that casting a constant string to "(char *)" is 
> a _cleanup_ is doing something seriously wrong.
> 
> That's crap, crap, crap, CRAP!

Sorry.  It got really annoying to skip over the same compiler warnings
in vim's quickfix window many times.  At that time I just wanted to
focus on the code I was writing.

> but THESE are total and utter CRAP:
> 
> -               mf->ptr = ""; /* does not matter */
> +               mf->ptr = (char *)""; /* does not matter */
> -                               s->data = "";
> +                               s->data = (char *)"";
> 
> and we're better off with the warning than with the new code.
> 
> I suspect that both could have been made to use NULL instead to indicate 
> that no pointer exists.

I'll look into this.

-- 
http://onion.dynserv.net/~timo/

^ permalink raw reply

* Re: What's in git.git
From: Linus Torvalds @ 2006-06-25 18:43 UTC (permalink / raw)
  To: Timo Hirvonen; +Cc: junkio, git
In-Reply-To: <20060625210724.934617c4.tihirvon@gmail.com>



On Sun, 25 Jun 2006, Timo Hirvonen wrote:
> > 
> > I suspect that both could have been made to use NULL instead to indicate 
> > that no pointer exists.
> 
> I'll look into this.

An alternative is to really mark the char pointer structure members const. 
That is often the preferred thing to do, if usage allows it.

The biggest problem I've traditionally had with structure members that are 
"const char *" has ironically been that the standard C definition of 
"free()" is misdesigned. 

"free()" should take a "const volatile void *", not just a "void *". As it 
is, you often have to cast things to free() just to avoid the warning 
about discarding qualifiers. Which is really sad.

It's perfectly valid to do something like

	struct xyzzy {
		const char *member;
		..
	};

	s->member = strdup(string);
	..
	free(s->member);
	free(s)

but sadly, that member free generates a (bogus) warning.

Of course, we should probably do a "xfree()" anyway, to match our 
"x[c|re]alloc()".

			Linus

^ permalink raw reply

* Re: PPC SHA-1 Updates in "pu"
From: Randal L. Schwartz @ 2006-06-25 18:46 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Petr Baudis, git, Linus Torvalds
In-Reply-To: <Pine.LNX.4.63.0606251537450.29667@wbgn013.biozentrum.uni-wuerzburg.de>

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

Johannes> Perl, Python and sometimes even bash are good for fast
Johannes> prototyping. But for serious work, such as profiling, they are not
Johannes> that good.

Allow my to register my strong disagreement to that statement, but then I'll
crawl back in my hole.

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

^ permalink raw reply

* Re: [PATCH] correct documentation for git grep
From: Johannes Schindelin @ 2006-06-25 23:10 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: Timo Hirvonen, git
In-Reply-To: <E1FuX8l-0001H5-2z@moooo.ath.cx>

Hi,

On Sun, 25 Jun 2006, Matthias Lederhofer wrote:

> +-e::
> +	The next parameter is the pattern. This option has to be
> +	used for patterns starting with - and should be used in
> +	scripts passing user input to grep.

... and by the far the most common use is to pass more than one pattern. 
Also, the usage is "[-e] <pattern> [-e <pattern>...]".

Ciao,
Dscho

^ permalink raw reply

* Re: PPC SHA-1 Updates in "pu"
From: Johannes Schindelin @ 2006-06-25 23:23 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: Junio C Hamano, Petr Baudis, git, Linus Torvalds
In-Reply-To: <86veqp8456.fsf@blue.stonehenge.com>

Hi,

On Sun, 25 Jun 2006, Randal L. Schwartz wrote:

> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> Johannes> Perl, Python and sometimes even bash are good for fast
> Johannes> prototyping. But for serious work, such as profiling, they are not
> Johannes> that good.
> 
> Allow my to register my strong disagreement to that statement, but then I'll
> crawl back in my hole.

Which statement do you mean? The "good for fast prototyping" one? ;-)

Being our friendly local Perl wizard, who could code cvsserver as a Perl 
one-liner, you probably want to say that profiling Perl is easy. Can you 
enlighten me how to do memory _and_ timing profiling on, say, a per-line 
basis?

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] GIT_TRACE: show which built-in/external commands are executed
From: Johannes Schindelin @ 2006-06-25 23:30 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: git
In-Reply-To: <E1FuXBk-0001SG-3n@moooo.ath.cx>

Hi,

On Sun, 25 Jun 2006, Matthias Lederhofer wrote:

> > P.S.: Now we only have to convert all "git-" invocations in the scripts to
> > "git " invocations so we can benefit from it. But that would mean two 
> > forks instead of one for the non-builtins. Hmm.
> 
> Why do we not use this policy:
> 
> git-* is guaranteed to be the normal command without any strange alias
> expansion, default parameters or something else a script does not like
> to be changed in the commands. So all scripts use git-*, this will
> prevent a double exec. The path to git-* should be obtained using git
> --exec-path in the beginnig.

That still leaves my problem: GIT_TRACE=1 on scripts is incomplete.

Ciao,
Dscho

^ permalink raw reply

* [PATCH] correct documentation for git grep
From: Matthias Lederhofer @ 2006-06-25 23:39 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0606260108510.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
> ... and by the far the most common use is to pass more than one pattern. 
> Also, the usage is "[-e] <pattern> [-e <pattern>...]".
Ok, so I changed the patch :)

 Documentation/git-grep.txt |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 7b810df..3dd1bdd 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -16,7 +16,7 @@ SYNOPSIS
 	   [-n] [-l | --files-with-matches] [-L | --files-without-match]
 	   [-c | --count]
 	   [-A <post-context>] [-B <pre-context>] [-C <context>]
-	   [-f <file>] [-e <pattern>]
+	   [-f <file>] [-e] <pattern> [-e <pattern> [..]]
 	   [<tree>...]
 	   [--] [<path>...]
 
@@ -71,6 +71,12 @@ OPTIONS
 -f <file>::
 	Read patterns from <file>, one per line.
 
+-e::
+	The next parameter is a pattern. This option has to be
+	used for patterns starting with - and should be used in
+	scripts passing user input to grep. You can specify multiple
+	patterns which will be combined by or.
+
 `<tree>...`::
 	Search blobs in the trees for specified patterns.
 
-- 
1.4.1.rc1.g72a4-dirty

^ permalink raw reply related

* [PATCH] git-grep: --and to combine patterns with and instead of or
From: Matthias Lederhofer @ 2006-06-26  0:02 UTC (permalink / raw)
  To: git
In-Reply-To: <Pine.LNX.4.63.0606260108510.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
> ... and by the far the most common use is to pass more than one pattern. 
> Also, the usage is "[-e] <pattern> [-e <pattern>...]".

Here is a patch to allow combination of patterns with 'and' instead of
'or'. This makes it easier to search for combinations of words in a line
without using grep multiple times combined by pipes. So it is still
possible to use -A/-B/-C (something I miss in normal grep). --and
cannot be passed down, so we have to use the built-in version if it is
set.

 Documentation/git-grep.txt |    5 ++++-
 builtin-grep.c             |   17 +++++++++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index ebfe51b..df9d705 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -16,7 +16,7 @@ SYNOPSIS
 	   [-n] [-l | --files-with-matches] [-L | --files-without-match]
 	   [-c | --count]
 	   [-A <post-context>] [-B <pre-context>] [-C <context>]
-	   [-f <file>] [-e] <pattern> [-e <pattern> [..]]
+	   [-f <file>] [-e] <pattern> [-e <pattern> [..]] [--and]
 	   [<tree>...]
 	   [--] [<path>...]
 
@@ -77,6 +77,9 @@ OPTIONS
 	scripts passing user input to grep. You can specify multiple
 	patterns which will be combined by 'or'.
 
+--and::
+	Combine multiple patterns by 'and' instead of 'or'.
+
 `<tree>...`::
 	Search blobs in the trees for specified patterns.
 
diff --git a/builtin-grep.c b/builtin-grep.c
index d0677cc..a2a034a 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -96,6 +96,7 @@ struct grep_opt {
 	regex_t regexp;
 	unsigned linenum:1;
 	unsigned invert:1;
+	unsigned and:1;
 	unsigned name_only:1;
 	unsigned unmatch_name_only:1;
 	unsigned count:1;
@@ -268,7 +269,11 @@ static int grep_buffer(struct grep_opt *
 				    word_char(bol[pmatch[0].rm_eo]))
 					hit = 0;
 			}
-			if (hit)
+			if (opt->and && !hit) {
+				hit = 0;
+				break;
+			}
+			if (!opt->and && hit)
 				break;
 		}
 		/* "grep -v -e foo -e bla" should list lines
@@ -553,10 +558,10 @@ static int grep_cache(struct grep_opt *o
 #ifdef __unix__
 	/*
 	 * Use the external "grep" command for the case where
-	 * we grep through the checked-out files. It tends to
-	 * be a lot more optimized
+	 * we grep through the checked-out files and do not use
+	 * non-standard options. It tends to be a lot more optimized.
 	 */
-	if (!cached) {
+	if (!cached && !opt->and) {
 		hit = external_grep(opt, paths, cached);
 		if (hit >= 0)
 			return hit;
@@ -690,6 +695,10 @@ int cmd_grep(int argc, const char **argv
 			opt.binary = GREP_BINARY_TEXT;
 			continue;
 		}
+		if (!strcmp("--and", arg)) {
+			opt.and = 1;
+			continue;
+		}
 		if (!strcmp("-i", arg) ||
 		    !strcmp("--ignore-case", arg)) {
 			opt.regflags |= REG_ICASE;
-- 
1.4.1.rc1.g72a4-dirty

^ permalink raw reply related

* [PATCH] correct documentation for git grep
From: Matthias Lederhofer @ 2006-06-26  0:06 UTC (permalink / raw)
  To: git
In-Reply-To: <E1FueCE-0003W3-4Q@moooo.ath.cx>

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
The 'or' as logic or should be marked in the text. I did
that in the patch with --and too so if this is accepted the
documentation should be consistent. Sorry for the noise.

 Documentation/git-grep.txt |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 7b810df..ebfe51b 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -16,7 +16,7 @@ SYNOPSIS
 	   [-n] [-l | --files-with-matches] [-L | --files-without-match]
 	   [-c | --count]
 	   [-A <post-context>] [-B <pre-context>] [-C <context>]
-	   [-f <file>] [-e <pattern>]
+	   [-f <file>] [-e] <pattern> [-e <pattern> [..]]
 	   [<tree>...]
 	   [--] [<path>...]
 
@@ -71,6 +71,12 @@ OPTIONS
 -f <file>::
 	Read patterns from <file>, one per line.
 
+-e::
+	The next parameter is a pattern. This option has to be
+	used for patterns starting with - and should be used in
+	scripts passing user input to grep. You can specify multiple
+	patterns which will be combined by 'or'.
+
 `<tree>...`::
 	Search blobs in the trees for specified patterns.
 
-- 
1.4.1.rc1.g72a4-dirty

^ permalink raw reply related

* Re: A series file for git?
From: Shawn Pearce @ 2006-06-26  0:44 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Junio C Hamano, Linus Torvalds, Git Mailing List
In-Reply-To: <m1r71exww5.fsf@ebiederm.dsl.xmission.com>

"Eric W. Biederman" <ebiederm@xmission.com> wrote:
> Junio C Hamano <junkio@cox.net> writes:
[snip]
> > I am not sure about that.  What does the series file contain,
> > and what other things the meta data branch contain?  If you are
> > listing commit SHA1 in the series file, you _do_ have the risk
> > of losing things -- git-fsck-objects needs to look at such blob
> > object and consider that as the root of reachability chain; to
> > me that seems too specialized hack.
> 
> When described that way I agree.   The best I can imagine
> is to list those commits as ancestors of the current commit.
> Hmm.  Or possibly I could collect up tag objects and work
> with them.  In any case representing this in a non-hackish
> way is my goal.

I did this in pg.  It didn't work out very well as the GIT diff
tools (e.g. the diff in gitk) show the diff in a very odd way.
It did not work out as well as I had hoped.

> > I have a feeling that I really should study how well StGIT does
> > things before talking about this further.  It may suit your
> > needs perfectly.  What do you feel is lacking in StGIT that you
> > need?
> 
> What I want and what I see lacking in the git and StGit is
> the ability to record the history of editing the history
> of a branch. 
> 
> A mundane example.  It would be nice if I rebased a branch if
> I could record in some fashion what that branch was before
> I rebased it.

Use the new reflog code.  Its in 1.4.  Check the documentation for
git-update-ref for some details.  git-commit, git-rebase and git-am
should track history on a ref in the reflog.  However a reflog
won't anchor a commit into your repository and thus a prune may
remove it if no other commit/ref/tag mentions it.

-- 
Shawn.

^ permalink raw reply

* perl profiling (was: PPC SHA-1 Updates in "pu")
From: Jeff King @ 2006-06-26  1:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Randal L. Schwartz, git
In-Reply-To: <Pine.LNX.4.63.0606260121040.29667@wbgn013.biozentrum.uni-wuerzburg.de>

On Mon, Jun 26, 2006 at 01:23:21AM +0200, Johannes Schindelin wrote:

> one-liner, you probably want to say that profiling Perl is easy. Can you 
> enlighten me how to do memory _and_ timing profiling on, say, a per-line 
> basis?

For the timing, have you tried using Devel::SmallProf?
  perl -d:SmallProf foo.pl

-Peff

^ permalink raw reply

* Re: [PATCH] Git.pm build: Fix quoting and missing GIT-CFLAGS dependency
From: Junio C Hamano @ 2006-06-26  6:48 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git
In-Reply-To: <20060625152157.GG21864@pasky.or.cz>

Petr Baudis <pasky@suse.cz> writes:

> Could you please also throw in these two?
>
> [PATCH 3/7] Git.pm: Swap hash_object() parameters
> [PATCH 4/7] Git.pm: Fix Git->repository("/somewhere/totally/elsewhere")

Will take a look.

> Yes, -I is very broken. I have abandoned it in:
>
> 	Subject: Re: [PATCH 01/12] Introduce Git.pm (v4)
> 	Date:   Sat, 24 Jun 2006 13:52:27 +0200
>
> The advantage to your approach is that it works properly without
> requiring to make install even outside of the testsuite.

I remember myself getting utterly discusted when I saw the
inclusion of the build-time blib directory in the search path in
some other Perl code outside git.

Worse yet, I suspect the order you do the two directories is
wrong to prefer the freshly built one over the one you installed
the last time, but I was trying not to stare at too much for
health reasons so ... ;-).

^ permalink raw reply

* Re: PPC SHA-1 Updates in "pu"
From: Junio C Hamano @ 2006-06-26  6:49 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Petr Baudis, git, Linus Torvalds, Randal L. Schwartz
In-Reply-To: <Pine.LNX.4.63.0606251537450.29667@wbgn013.biozentrum.uni-wuerzburg.de>

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

> I can live with it. Although I still think that it would be a good idea to 
> convert (at least the most commonly used) scripts to C.
>
> Perl, Python and sometimes even bash are good for fast prototyping. But 
> for serious work, such as profiling, they are not that good.

I expect the eventual primary customer of Git.xs to be gitweb.

I do not necessarily agree with what you just said about
scripting languages.  Shell is a very good implementation
language for certain serious things that does not require
performance and non command line UI.

> And you can see different behaviour on different platforms (plus things 
> like the SunCC requirement for XS on Solaris), which make the scripts less 
> robust.

I am not sure about "less robust" part, but it certainly
involves initial pain to deal with portability across platforms.

That's why I want to make sure that the basics is sound before
we spend too much time and attention on converting existing
scripts.  I think the major part of bringing Git.xs series
acceptably mergeable is not about XS programming and Perl script
conversion, but primarily about the work on the build
infrastructure (Makefile, test scripts and .spec).

^ permalink raw reply

* Re: [PATCH] correct documentation for git grep
From: Johannes Schindelin @ 2006-06-26  6:59 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: git
In-Reply-To: <E1Fuecp-0004iI-RG@moooo.ath.cx>

Hi,

On Mon, 26 Jun 2006, Matthias Lederhofer wrote:

> -	   [-f <file>] [-e <pattern>]
> +	   [-f <file>] [-e] <pattern> [-e <pattern> [..]]
>  	   [<tree>...]
>  	   [--] [<path>...]

Minor nit: as you can see from the two latter lines, "<bla>..." is the 
standard notation, whereas "<bla> [..]" is not.

Ciao,
Dscho

^ permalink raw reply


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