Commit Graph

4838 Commits

Author SHA1 Message Date
Linus Torvalds
bbb66c6061 builtin-grep: workaround for non GNU grep.
Of course, it still ignores the fact that not all grep's support some of
the flags like -F/-L/-A/-C etc, but for those cases, the external grep
itself will happily just say "unrecognized option -F" or similar.

So with this change, "git grep" should handle all the flags the native
grep handles, which is really quite fine. We don't _need_ to expose
anything more, and if you do want our extensions, you can get them with
"--uncached" and an up-to-date index.

No configuration necessary, and we automatically take advantage of any
native grep we have, if possible.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 15:51:38 -07:00
Junio C Hamano
e9ce27543d Merge branch 'ew/pretty-fmt'
* ew/pretty-fmt:
  commit: allow --pretty= args to be abbreviated
2006-05-17 15:49:23 -07:00
Junio C Hamano
53684bba49 Merge branch 'jc/apply'
* jc/apply:
  git-am: use apply --cached
  apply --cached: apply a patch without using working tree.
  apply --numstat: show new name, not old name.
2006-05-17 15:47:33 -07:00
Junio C Hamano
ae12e59a8c Merge branch 'lt/dirwalk' into next
* lt/dirwalk:
  builtin-add: warn on unmatched pathspecs
  Do "git add" as a builtin
  Clean up git-ls-file directory walking library interface
  libify git-ls-files directory traversal

Not a conflict, but builtin-add needed to be adjusted to properly
invalidate the cache_tree entry.
2006-05-17 15:39:38 -07:00
Linus Torvalds
f25933987f builtin-add: warn on unmatched pathspecs
This is in the same spirit as what bba319b5 and 45e48120 tried
to do to help users.  A command such as "git add Documentaiton"
with misspelled pathspecs would give a friendly reminder with
this.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 15:27:18 -07:00
Linus Torvalds
0d78153952 Do "git add" as a builtin
First try. Let's see how well this works.

In many ways, the hard parts of "git commit" are not so different from
this, and a builtin commit would share a lot of the code, I think.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 11:52:40 -07:00
Junio C Hamano
e78503db16 Revert "builtin-grep: workaround for non GNU grep."
This reverts 518920b764 commit.
Linus has a more portable alternative.
2006-05-17 11:42:14 -07:00
Junio C Hamano
d882e1ac94 Merge branch 'jc/gitlink' into next
* jc/gitlink:
  read-tree: reorganize bind_merge code.
2006-05-17 03:16:50 -07:00
Junio C Hamano
d6970e42a1 read-tree: reorganize bind_merge code.
This does not change the logic but moves the order of checks
around so that merging of read-tree safety code would become
easier.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 03:16:27 -07:00
Junio C Hamano
aedb8995f8 Merge branch 'ew/pretty-fmt' into next
* ew/pretty-fmt:
  commit: allow --pretty= args to be abbreviated

Conflicts:

	commit.c - adjust to --pretty=email
2006-05-17 03:04:14 -07:00
Junio C Hamano
fa09339509 Merge branch 'jc/grep' into next
* jc/grep:
  builtin-grep: workaround for non GNU grep.
2006-05-17 02:59:46 -07:00
Eric Wong
6cdfd17974 commit: allow --pretty= args to be abbreviated
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 02:57:57 -07:00
Junio C Hamano
518920b764 builtin-grep: workaround for non GNU grep.
Some implementations do not know what to do with -H; define
NO_H_OPTION_IN_GREP when you build git if your grep lacks -H.

Most of the time, it can be worked around by prepending
/dev/null to the argument list, but that causes -L and -c to
slightly misbehave (they both expose /dev/null is given), so
when these options are given, do not run external grep that does
not understand -H.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 02:48:13 -07:00
Linus Torvalds
b4189aa848 Clean up git-ls-file directory walking library interface
This moves the code to add the per-directory ignore files for the base
directory into the library routine.

That not only allows us to turn the function push_exclude_per_directory()
static again, it also simplifies the library interface a lot (the caller
no longer needs to worry about any of the per-directory exclude files at
all).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 01:56:55 -07:00
Linus Torvalds
453ec4bdf4 libify git-ls-files directory traversal
This moves the core directory traversal and filename exclusion logic
into the general git library, making it available for other users
directly.

If we ever want to do "git commit" or "git add" as a built-in (and we
do), we want to be able to handle most of git-ls-files as a library.

NOTE! Not all of git-ls-files is libified by this.  The index matching
and pathspec prefix calculation is still in ls-files.c, but this is a
big part of it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 01:56:40 -07:00
Junio C Hamano
fcc387db9b read-tree -m -u: do not overwrite or remove untracked working tree files.
When a merge results in a creation of a path that did not exist
in HEAD, and if you already have that path on the working tree,
because the index has not been told about the working tree file,
read-tree happily removes it.  The issue was brought up by Santi
Béjar on the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 01:52:48 -07:00
Junio C Hamano
8a24f2fae0 Merge branch 'master' into next
* master:
  Remove old "git-grep.sh" remnants
  merge-base: Clarify the comments on post processing.
  Update the documentation for git-merge-base
2006-05-16 17:21:35 -07:00
Linus Torvalds
63dffdf03d Remove old "git-grep.sh" remnants
It's built-in now.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16 17:21:21 -07:00
Junio C Hamano
5c87a8c560 Merge branch 'maint'
* maint:
  merge-base: Clarify the comments on post processing.
  Update the documentation for git-merge-base
2006-05-16 17:21:02 -07:00
Junio C Hamano
0fa6417c49 Merge branch 'np/pack'
* np/pack:
  improve depth heuristic for maximum delta size
  pack-object: slightly more efficient
  simple euristic for further free packing improvements
2006-05-16 17:20:24 -07:00
Junio C Hamano
c82a22c39c merge-base: Clarify the comments on post processing.
The comment fooled myself believing that we still had an
unsolved horizon effect.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16 17:18:22 -07:00
Junio C Hamano
00dd7422db Merge branch 'np/pack' into next
* np/pack:
  improve depth heuristic for maximum delta size
2006-05-16 14:50:26 -07:00
Nicolas Pitre
c3b06a69ff improve depth heuristic for maximum delta size
This provides a linear decrement on the penalty related to delta depth
instead of being an 1/x function.  With this another 5% reduction is
observed on packs for both the GIT repo and the Linux kernel repo, as
well as fixing a pack size regression in another sample repo I have.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16 13:35:46 -07:00
Junio C Hamano
94cdb38258 Merge branch 'se/tag'
* se/tag:
  Strip useless "tags/" prefix from git-tag -l output
2006-05-15 23:43:27 -07:00
Junio C Hamano
3aece89fa2 Merge branch 'se/rev-parse'
* se/rev-parse:
  Add "--branches", "--tags" and "--remotes" options to git-rev-parse.
2006-05-15 23:43:23 -07:00
Junio C Hamano
638684824c Merge branch 'se/diff'
* se/diff:
  Convert some "apply --summary" users to "diff --summary".
  Add "--summary" option to git diff.
2006-05-15 23:42:37 -07:00
Junio C Hamano
3b4fd63f72 Merge branch 'se/rebase'
* se/rebase:
  Make git rebase interactive help match documentation.
2006-05-15 23:35:24 -07:00
Fredrik Kuivinen
2aa839614e Update the documentation for git-merge-base
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 23:19:46 -07:00
Junio C Hamano
70bde2bc31 Merge branch 'jc/diff' into next
* jc/diff:
  builtin-diff: fix comparison between two blobs.
2006-05-15 19:06:06 -07:00
Junio C Hamano
e4e23f3a1c builtin-diff: fix comparison between two blobs.
The code forgot that setup_revisions() leaves parsed object
names in reverse in the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 19:05:50 -07:00
Junio C Hamano
35702a983e Merge branch 'master' into next
* master:
  Fix silly typo in new builtin grep
  Fix pack-index issue on 64-bit platforms a bit more portably.
  Install git-send-email by default
  Fix compilation on newer NetBSD systems
2006-05-15 18:26:34 -07:00
Junio C Hamano
8701ea0f62 Merge branch 'lt/oneway'
* lt/oneway:
  read-tree --reset -u fix.
  read-tree -u one-way merge fix to check out locally modified paths.
  Simplify "git reset --hard"
  Allow one-way tree merge to remove old files
2006-05-15 18:15:26 -07:00
Junio C Hamano
63166cd64f Merge branch 'ew/send-email'
* ew/send-email:
  send-email: quiet some warnings, reject invalid addresses
  send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 18:15:03 -07:00
Junio C Hamano
3adac0afe2 Merge branch 'lt/config'
* lt/config:
2006-05-15 18:12:57 -07:00
Junio C Hamano
efca578eec Merge branch 'jc/grep'
* jc/grep: (22 commits)
  Fix silly typo in new builtin grep
  builtin-grep: unparse more command line options.
  builtin-grep: use external grep when we can take advantage of it
  builtin-grep: -F (--fixed-strings)
  builtin-grep: -w fix
  builtin-grep: typofix
  builtin-grep: tighten argument parsing.
  builtin-grep: documentation
  Teach -f <file> option to builtin-grep.
  builtin-grep: -L (--files-without-match).
  builtin-grep: binary files -a and -I
  builtin-grep: terminate correctly at EOF
  builtin-grep: tighten path wildcard vs tree traversal.
  builtin-grep: support -w (--word-regexp).
  builtin-grep: support -c (--count).
  builtin-grep: allow more than one patterns.
  builtin-grep: allow -<n> and -[ABC]<n> notation for context lines.
  builtin-grep: printf %.*s length is int, not ptrdiff_t.
  builtin-grep: do not use setup_revisions()
  builtin-grep: support '-l' option.
  ...
2006-05-15 18:12:06 -07:00
Junio C Hamano
05f743f328 Merge branch 'lt/diff'
* lt/diff:
  git diff: support "-U" and "--unified" options properly
2006-05-15 18:09:15 -07:00
Linus Torvalds
f66475199c Fix silly typo in new builtin grep
The "-F" flag apparently got mis-translated due to some over-eager
copy-paste work into a duplicate "-H" when using the external grep.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 18:06:18 -07:00
Junio C Hamano
4cb0e688d8 Merge branch 'jc/apply' into next
* jc/apply:
  git-am: use apply --cached
  apply --cached: apply a patch without using working tree.
2006-05-15 17:58:02 -07:00
Junio C Hamano
b7627278e2 git-am: use apply --cached
Now 'git apply' can apply patch without working tree, preparation
of pristine preimage and postimage trees that are done when falling
back on 3-way merge by "git am" can do so without temporary files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 17:57:01 -07:00
Junio C Hamano
04e4888e5a apply --cached: apply a patch without using working tree.
A new flag "--cached" takes the cached data, applies the patch
and stores the result in the index, without using the working
tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 17:56:53 -07:00
Junio C Hamano
baee9207b9 Merge branch 'jc/grep' into next
* jc/grep:
  builtin-grep: unparse more command line options.
2006-05-15 13:51:35 -07:00
Junio C Hamano
440f869d65 Merge branch 'ew/send-email' into next
* ew/send-email:
  send-email: quiet some warnings, reject invalid addresses
  send-email: allow sendmail binary to be used instead of SMTP
2006-05-15 13:51:23 -07:00
Junio C Hamano
8dd84b0169 Merge branch 'np/pack' into next
* np/pack:
  pack-object: slightly more efficient
  simple euristic for further free packing improvements
2006-05-15 13:51:09 -07:00
Junio C Hamano
f6fb133b84 Merge branch 'lt/oneway' into next
* lt/oneway:
  read-tree --reset -u fix.
2006-05-15 13:51:07 -07:00
Junio C Hamano
d55aaefa3e Merge branch 'fix'
* fix:
  Fix pack-index issue on 64-bit platforms a bit more portably.
  Install git-send-email by default
  Fix compilation on newer NetBSD systems
  git config syntax updates
  Another config file parsing fix.
  checkout: use --aggressive when running a 3-way merge (-m).
2006-05-15 13:48:22 -07:00
Junio C Hamano
ffa0a7ab36 builtin-grep: unparse more command line options.
The earlier one to use external grep missed some often used options.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:28:01 -07:00
Junio C Hamano
1b9bc5a7b7 Fix pack-index issue on 64-bit platforms a bit more portably.
Apparently <stdint.h> is not enough for uint32_t on OpenBSD; use
"unsigned int" -- hopefully that would stay 32-bit on every
platform we care about, at least until we update the pack-index
file format.

Our sha1 routines optimized for architectures use uint32_t and
expects '#include <stdint.h>' to be enough, so OpenBSD on arm or
ppc might have similar issues down the road, I dunno.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:01:37 -07:00
Eric Wong
f3dd5eae58 Install git-send-email by default
After 567ffeb772 and
4bc87a28be, git-send-email no
longer requires any non-standard Perl modules, so there's no
reason to special-case it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:28 -07:00
Dennis Stosberg
e88856b485 Fix compilation on newer NetBSD systems
NetBSD >=2.0 has iconv() in libc.  A libiconv is not required and
does not exist.

See: http://netbsd.gw.com/cgi-bin/man-cgi?iconv+3+NetBSD-2.0

[jc: with a bit of simplification later discussed on the list.]

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:01 -07:00
Nicolas Pitre
ff45715ce5 pack-object: slightly more efficient
Avoid creating a delta index for objects with maximum depth since they
are not going to be used as delta base anyway.  This also reduce peak
memory usage slightly as the current object's delta index is not useful
until the next object in the loop is considered for deltification. This
saves a bit more than 1% on CPU usage.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 12:32:13 -07:00