summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2006-05-20Merge branch 'lt/dirwalk' into jc/dirwalk-n-cache-treeLibravatar Junio C Hamano13-550/+899
This commit is what this branch is all about. It records the evil merge needed to adjust built-in git-add and git-rm for the cache-tree extension. * lt/dirwalk: Add builtin "git rm" command Move pathspec matching from builtin-add.c into dir.c Prevent bogus paths from being added to the index. builtin-add: fix unmatched pathspec warnings. Remove old "git-add.sh" remnants 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 Conflicts: Makefile builtin.h git.c update-index.c
2006-05-20Merge branch 'jc/cache-tree' into jc/dirwalk-n-cache-treeLibravatar Junio C Hamano13-128/+830
* jc/cache-tree: (24 commits) Fix crash when reading the empty tree fsck-objects: do not segfault on missing tree in cache-tree cache-tree: a bit more debugging support. read-tree: invalidate cache-tree entry when a new index entry is added. Fix test-dump-cache-tree in one-tree disappeared case. fsck-objects: mark objects reachable from cache-tree cache-tree: replace a sscanf() by two strtol() calls cache-tree.c: typefix test-dump-cache-tree: validate the cached data as well. cache_tree_update: give an option to update cache-tree only. read-tree: teach 1-way merege and plain read to prime cache-tree. read-tree: teach 1 and 2 way merges about cache-tree. update-index: when --unresolve, smudge the relevant cache-tree entries. test-dump-cache-tree: report number of subtrees. cache-tree: sort the subtree entries. Teach fsck-objects about cache-tree. index: make the index file format extensible. cache-tree: protect against "git prune". Add test-dump-cache-tree Use cache-tree in update-index. ...
2006-05-19Merge branch 'js/fetchconfig'Libravatar Junio C Hamano2-4/+59
* js/fetchconfig: Add a conversion tool to migrate remote information into the config fetch, pull: ask config for remote information
2006-05-19Add builtin "git rm" commandLibravatar Linus Torvalds5-73/+157
This changes semantics very subtly, because it adds a new atomicity guarantee. In particular, if you "git rm" several files, it will now do all or nothing. The old shell-script really looped over the removed files one by one, and would basically randomly fail in the middle if "-f" was used and one of the files didn't exist in the working directory. This C builtin one will not re-write the index after each remove, but instead remove all files at once. However, that means that if "-f" is used (to also force removal of the file from the working directory), and some files have already been removed from the workspace, it won't stop in the middle in some half-way state like the old one did. So what happens is that if the _first_ file fails to be removed with "-f", we abort the whole "git rm". But once we've started removing, we don't leave anything half done. If some of the other files don't exist, we'll just ignore errors of removal from the working tree. This is only an issue with "-f", of course. I think the new behaviour is strictly an improvement, but perhaps more importantly, it is _different_. As a special case, the semantics are identical for the single-file case (which is the only one our test-suite seems to test). The other question is what to do with leading directories. The old "git rm" script didn't do anything, which is somewhat inconsistent. This one will actually clean up directories that have become empty as a result of removing the last file, but maybe we want to have a flag to decide the behaviour? Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Fix build procedure for builtin-init-dbLibravatar Junio C Hamano1-1/+1
c3c8835fbb182d971d71939b9a3ec7c8b86d6caf broke the default template location which is in builtin-init-db.o, by not supplying the compilation-time constant to the right build commands. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Merge branch 'jc/read-tree-safety'Libravatar Junio C Hamano5-31/+88
* jc/read-tree-safety: read-tree -m -u: do not overwrite or remove untracked working tree files.
2006-05-19Merge branch 'jc/apply'Libravatar Junio C Hamano1-4/+6
* jc/apply: apply --cached: do not check newly added file in the working tree
2006-05-19Merge branch 'eb/quilt'Libravatar Junio C Hamano3-1/+180
* eb/quilt: Implement a --dry-run option to git-quiltimport Implement git-quiltimport
2006-05-19Merge branch 'jc/grep'Libravatar Junio C Hamano0-0/+0
* jc/grep: Revert "builtin-grep: workaround for non GNU grep." builtin-grep: workaround for non GNU grep.
2006-05-19Merge branch 'lt/grep'Libravatar Junio C Hamano3-60/+75
* lt/grep: builtin-grep: workaround for non GNU grep. git-am: use apply --cached apply --cached: apply a patch without using working tree. apply --numstat: show new name, not old name.
2006-05-19Merge branch 'ts/doctar'Libravatar Junio C Hamano2-3/+27
* ts/doctar: Documentation/Makefile: create tarballs for the man pages and html files
2006-05-19Allow pickaxe and diff-filter options to be used by git log.Libravatar Sean1-0/+7
Handle the -S option when passed to git log such that only the appropriate commits are displayed. Also per Junio's comments, do the same for "--diff-filter", so that it too can be used as an option to git log. By default no patch or diff information is displayed. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Move pathspec matching from builtin-add.c into dir.cLibravatar Linus Torvalds3-81/+84
I'll use it for builtin-rm.c too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Libify the index refresh logicLibravatar Linus Torvalds3-122/+129
This cleans up and libifies the "git update-index --[really-]refresh" functionality. This will be eventually required for eventually doing the "commit" and "status" commands as built-ins. It really just moves "refresh_index()" from update-index.c to read-cache.c, but it also has to change the calling convention so that the function uses a "unsigned int flags" argument instead of various static flags variables for passing down the information about whether to be quiet or not, and allow unmerged entries etc. That actually cleans up update-index.c too, since it turns out that all those flags were really specific to that one function of the index update, so they shouldn't have had file-scope visibility even before. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Builtin git-init-dbLibravatar Timo Hirvonen4-12/+15
Basically this just renames init-db.c to builtin-init-db.c and makes some strings const. Signed-off-by: Timo Hirvonen <tihirvon@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Merge early part of 'sp/reflog' branchLibravatar Junio C Hamano1-4/+1
2006-05-18Implement a --dry-run option to git-quiltimportLibravatar Eric W. Biederman2-7/+25
Since large quilt trees like -mm can easily have patches without clear authorship information, add a --dry-run option to make the problem patches easy to find. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Implement git-quiltimportLibravatar Eric W. Biederman3-1/+162
Importing a quilt patch series into git is not very difficult but parsing the patch descriptions and all of the other minutia take a bit of effort to get right, so this automates it. Since git and quilt complement each other it makes sense to make it easy to go back and forth between the two. If a patch is encountered that it cannot derive the author from the user is asked. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Documentation/Makefile: create tarballs for the man pages and html filesLibravatar Tilman Sauerbeck2-3/+27
[jc: rewrote by stealing from what I run to update html and man branches automatically] Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18SubmittingPatches: The download location of External Editor has movedLibravatar Lukas Sandström1-2/+2
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Make git-check-format-ref a builtin.Libravatar Lukas Sandström5-20/+19
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Make "git rev-list" be a builtinLibravatar Linus Torvalds4-5/+8
This was surprisingly easy. The diff is truly minimal: rename "main()" to "cmd_rev_list()" in rev-list.c, and rename the whole file to reflect its new built-in status. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18builtin-diff: do not say files are renamed when blob and file are givenLibravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Prevent bogus paths from being added to the index.Libravatar Linus Torvalds3-64/+67
With this one, it's now a fatal error to try to add a pathname that cannot be added with "git add", i.e. [torvalds@g5 git]$ git add .git/config fatal: unable to add .git/config to index and [torvalds@g5 git]$ git add foo/../bar fatal: unable to add foo/../bar to index instead of the old "Ignoring path xyz" warning that would end up silently succeeding on any other paths. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18builtin-add: fix unmatched pathspec warnings.Libravatar Junio C Hamano1-1/+1
"git add Documentation/" when Documentation directory exists does not barf (as it should not), but "git add ." barfed when it did not add anything. This was because we checked for the path prefix ("Documentation/" in the former case, and an empty string in the latter case) for existence, and lstat("", &st) would say "Huh?". Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18Provide a way to flush git-diff-tree's outputLibravatar Paul Mackerras1-1/+4
Gitk wants to use git-diff-tree as a filter to tell it which ids from a given list affect a set of files or directories. We don't want to fork and exec a new git-diff-tree process for each batch of ids, since there could be a lot of relatively small batches. For example, a batch could contain as many ids as fit in gitk's headline display window, i.e. 20 or so, and we would be processing a new batch every time the user scrolls that window. The --stdin flag to git-diff-tree is suitable for this, but the main difficulty is that the output of git-diff-tree gets buffered and doesn't get sent until the buffer is full. This provides a way to get git-diff-tree to flush its output buffers. If a blank line is supplied on git-diff-tree's standard input, it will flush its output buffers and then accept further input. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: git-cvsimport: Handle "Removed" from pserver
2006-05-17git-cvsimport: Handle "Removed" from pserverLibravatar Elrond1-1/+1
Sometimes the pserver says "Removed" instead of "Remove-entry". Signed-off-by: Elrond <elrond+kernel.org@samba-tng.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17Remove old "git-add.sh" remnantsLibravatar Linus Torvalds2-58/+2
Repeat after me: "It's now a built-in" Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17Remove unnecessary local in get_ref_sha1.Libravatar Shawn Pearce1-4/+1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17apply --cached: do not check newly added file in the working treeLibravatar Junio C Hamano1-4/+6
The --cached mode does not deal with the working tree, so we should not check it with lstat. An earlier code omitted the call to lstat but forgot to omit the check for the errno. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17builtin-grep: workaround for non GNU grep.Libravatar Linus Torvalds1-3/+20
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-17Merge branch 'ew/pretty-fmt'Libravatar Junio C Hamano1-14/+24
* ew/pretty-fmt: commit: allow --pretty= args to be abbreviated
2006-05-17Merge branch 'jc/apply'Libravatar Junio C Hamano2-57/+55
* 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-17builtin-add: warn on unmatched pathspecsLibravatar Linus Torvalds1-19/+58
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-17Do "git add" as a builtinLibravatar Linus Torvalds4-1/+231
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-17Revert "builtin-grep: workaround for non GNU grep."Libravatar Junio C Hamano2-30/+3
This reverts 518920b764ee9150781e68217181b24d0712748e commit. Linus has a more portable alternative.
2006-05-17commit: allow --pretty= args to be abbreviatedLibravatar Eric Wong1-14/+24
Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17builtin-grep: workaround for non GNU grep.Libravatar Junio C Hamano2-3/+30
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-17Clean up git-ls-file directory walking library interfaceLibravatar Linus Torvalds3-24/+28
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-17libify git-ls-files directory traversalLibravatar Linus Torvalds4-336/+376
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-17read-tree -m -u: do not overwrite or remove untracked working tree files.Libravatar Junio C Hamano5-31/+88
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-16Remove old "git-grep.sh" remnantsLibravatar Linus Torvalds2-64/+3
It's built-in now. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16Merge branch 'maint'Libravatar Junio C Hamano2-7/+20
* maint: merge-base: Clarify the comments on post processing. Update the documentation for git-merge-base
2006-05-16Merge branch 'np/pack'Libravatar Junio C Hamano2-13/+16
* np/pack: improve depth heuristic for maximum delta size pack-object: slightly more efficient simple euristic for further free packing improvements
2006-05-16merge-base: Clarify the comments on post processing.Libravatar Junio C Hamano1-3/+6
The comment fooled myself believing that we still had an unsolved horizon effect. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16improve depth heuristic for maximum delta sizeLibravatar Nicolas Pitre1-2/+5
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-15Merge branch 'se/tag'Libravatar Junio C Hamano1-5/+3
* se/tag: Strip useless "tags/" prefix from git-tag -l output
2006-05-15Merge branch 'se/rev-parse'Libravatar Junio C Hamano5-7/+48
* se/rev-parse: Add "--branches", "--tags" and "--remotes" options to git-rev-parse.
2006-05-15Merge branch 'se/diff'Libravatar Junio C Hamano6-6/+96
* se/diff: Convert some "apply --summary" users to "diff --summary". Add "--summary" option to git diff.