login
Header Space

 
 

Re: Error converting from 1.4.4.1 to 1.5.0?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bill Lear <rael@...>
Cc: Junio C Hamano <junkio@...>, <git@...>
Date: Wednesday, February 14, 2007 - 7:03 pm

On Wed, 14 Feb 2007, Bill Lear wrote:

Heh.

I'm relieved git is off the hook, although I think we should still look at 
that SIGSEGV. We might well have some situation where we react badly do a 
corrupt pack (most likely, by having one of the object parsing routines 
return NULL, and then we follow that NULL pointer rather than saying "bad 
object").


This is just one reason I don't ever use 'find' on my source tree. I long 
ago used to do

	find . -name '*.c' | xargs grep ...

etc, but especially with git I have almost totally stopped using "xargs 
grep" entirely - to the point where I actually end up importing tar-files 
into new git archives just because I'm so used to "git grep".

So I would suggest that in order to avoid this in the future, you teach 
your fingers to say "git grep" instead of "xgrep"., which I assume is just 
some local alias of yours for "find .. | xargs grep"?

"git grep" really works wonderfully well, and you could have just done

	perl -pi -e 's/.*\$Id.*//sx' $(git grep -l '[$]Id')

instead.

("git grep" is much nicer than "xargs grep" in many other ways too. You 
can ask it to limit itself to a certain pattern of filenames etc by doing

	git grep -l '[$]Id' -- 'net/*.[ch]'

as long as you realize that the name pattern for git grep considers '*' to 
act like '**' does for some shells - ie it globs against '/'too, so the 
above will find any C and header files under the net/ directory, however 
deep they are.. And you can ask it to grep in just a certain revision etc 
too).

Once you get used to "git grep", I bet you'll forget all about "xgrep", 
and won't have to worry about going into the .git/ directory by mistake 
any more.

There are other tricks you can do, but they are somewhat inconvenient. 
They range from making ".git" a symlink to somewhere else (to stop 
"find" from following it), and in your case, since you apparently already 
have an "xgrep" alias for this, you could just teach your "find" thing to 
do something like what we do in the kernel Makefile:

	RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o

and then we use

	find . $(RCS_FIND_IGNORE) ...

which knows to ignore ".git" directories along with all the other 
SCCS/CVS/SVN/BK/etc directories.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 12:12 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 1:15 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 1:20 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 2:19 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 5:13 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 5:35 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 2:42 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 1:45 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 4:49 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 5:32 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Nicolas Pitre, (Wed Feb 14, 5:14 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 5:12 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 5:18 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 4:58 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 5:19 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 5:40 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Uwe , (Thu Feb 15, 4:40 am)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 7:03 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Nicolas Pitre, (Wed Feb 14, 6:27 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Linus Torvalds, (Wed Feb 14, 7:24 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 6:41 pm)
OT: data destruction classics (was: Re: Error converting fro..., Simon 'corecode' Schubert..., (Wed Feb 14, 9:18 pm)
Re: OT: data destruction classics (was: Re: Error converting..., Johannes Schindelin, (Thu Feb 15, 6:24 am)
Re: OT: data destruction classics (was: Re: Error converting..., Michael K. Edwards, (Thu Feb 15, 9:13 am)
Re: Error converting from 1.4.4.1 to 1.5.0?, Johannes Schindelin, (Wed Feb 14, 6:02 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 5:47 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 5:52 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Johannes Schindelin, (Wed Feb 14, 6:04 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Junio C Hamano, (Wed Feb 14, 6:13 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Olivier Galibert, (Wed Feb 14, 8:54 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Johannes Schindelin, (Wed Feb 14, 9:36 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Johannes Schindelin, (Wed Feb 14, 6:32 pm)
Re: Error converting from 1.4.4.1 to 1.5.0?, Bill Lear, (Wed Feb 14, 1:07 pm)
speck-geostationary