aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* write-tree: --prefix=<path>Junio C Hamano2006-05-01
| | | | | | | | | | | | | | | | | | | | The "bind" commit can express an aggregation of multiple projects into a single commit. In such an organization, there would be one project, root of whose tree object is at the same level of the root of the aggregated projects, and other projects have their toplevel in separate subdirectories. Let's call that root level project the "primary project", and call other ones just "subprojects". You would first read-tree the primary project, and then graft the subprojects under their appropriate location using read-tree --prefix=<subdir>/ repeatedly. To write out a tree object from such an index for a subproject, write-tree --prefix=<subdir>/ is used. Signed-off-by: Junio C Hamano <junkio@cox.net>
* read-tree: --prefix=<path>/ option.Junio C Hamano2006-05-01
| | | | | | | | | | | With "--prefix=<path>/" option, read-tree keeps the current index contents, and reads the contents of named tree-ish under directory at `<prefix>`. The original index file cannot have anything at the path `<prefix>` itself, and have nothing in `<prefix>/` directory. This can be used to graft an independent tree into a subdirectory of the current index. Signed-off-by: Junio C Hamano <junkio@cox.net>
* fsck-objects: mark objects reachable from cache-treeJunio C Hamano2006-05-01
| | | | | | | When fsck-objects scanned cache-tree, it forgot to mark the trees it found reachable and in use. Signed-off-by: Junio C Hamano <junkio@cox.net>
* cache-tree: replace a sscanf() by two strtol() callsJohannes Schindelin2006-05-01
| | | | | | | | | | | | | | | On one of my systems, sscanf() first calls strlen() on the buffer. But this buffer is not terminated by NUL. So git crashed. strtol() does not share that problem, as it stops reading after the first non-digit. [jc: original patch was wrong and did not read the cache-tree structure correctly; this has been fixed up and tested minimally with fsck-objects. ] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* cache-tree.c: typefixJunio C Hamano2006-04-27
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* test-dump-cache-tree: validate the cached data as well.Junio C Hamano2006-04-27
| | | | | | | While dumping the cached data, try recomputing everything from scratch to make sure things match. Signed-off-by: Junio C Hamano <junkio@cox.net>
* cache_tree_update: give an option to update cache-tree only.Junio C Hamano2006-04-27
| | | | | | | | When the extra "dryrun" parameter is true, cache_tree_update() recomputes the invalid entry but does not actually creates new tree object. Signed-off-by: Junio C Hamano <junkio@cox.net>
* read-tree: teach 1-way merege and plain read to prime cache-tree.Junio C Hamano2006-04-27
| | | | | | | | | | | This teaches read-tree to fully populate valid cache-tree when reading a tree from scratch, or reading a single tree into an existing index, reusing only the cached stat information (i.e. one-way merge). We have already taught update-index about cache-tree, so "git checkout" followed by updates to a few path followed by a "git commit" would become very efficient. Signed-off-by: Junio C Hamano <junkio@cox.net>
* read-tree: teach 1 and 2 way merges about cache-tree.Junio C Hamano2006-04-27
| | | | | | | | | | | | | | | | | | | | | This teaches one-way and two-way "read-tree -m" (and its special form, "read-tree --reset" as well) not to discard cache-tree but invalidate only the changed parts of the tree. When switching between related branches, this helps the eventual commit (i.e. write-tree) by keeping cache-tree valid as much as possible. This does not prime cache-tree yet, but we ought to be able to do that for no-merge (i.e. reading from a tree object) case and, and also perhaps 1 way merge case. With this patch applied, switching between the tip of Linux 2.6 kernel tree and a branch that touches one path (fs/ext3/Makefile) from it invalidates only 3 paths out of 1201 cache-tree entries in the index, and subsequent write-tree takes about a half as much time as before. Signed-off-by: Junio C Hamano <junkio@cox.net>
* update-index: when --unresolve, smudge the relevant cache-tree entries.Junio C Hamano2006-04-26
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'master' into jc/cache-treeJunio C Hamano2006-04-26
|\ | | | | | | | | | | | | | | | | * master: t0000-basic: more commit-tree tests. commit-tree.c: check_valid() microoptimization. Fix filename verification when in a subdirectory rebase: typofix. socksetup: don't return on set_reuse_addr() error
| * t0000-basic: more commit-tree tests.Junio C Hamano2006-04-26
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Merge branch 'fix'Junio C Hamano2006-04-26
| |\ | | | | | | | | | | | | | | | | | | | | | * fix: commit-tree.c: check_valid() microoptimization. Fix filename verification when in a subdirectory rebase: typofix. socksetup: don't return on set_reuse_addr() error
| | * commit-tree.c: check_valid() microoptimization.Junio C Hamano2006-04-26
| | | | | | | | | | | | | | | | | | | | | | | | There is no point reading the whole object just to make sure it exists and it is of the expected type. We added sha1_object_info() for such need after this code was written, so use it. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * Fix filename verification when in a subdirectoryLinus Torvalds2006-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are in a subdirectory of a git archive, we need to take the prefix of that subdirectory into accoung when we verify filename arguments. Noted by Matthias Lederhofer This also uses the improved error reporting for all the other git commands that use the revision parsing interfaces, not just git-rev-parse. Also, it makes the error reporting for mixed filenames and argument flags clearer (you cannot put flags after the start of the pathname list). [jc: with fix to a trivial typo noticed by Timo Hirvonen] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * rebase: typofix.Junio C Hamano2006-04-26
| | | | | | | | | | | | | | | | | | Noticed by Sean. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * socksetup: don't return on set_reuse_addr() errorv1.3.1Serge E. Hallyn2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The set_reuse_addr() error case was the only error case in socklist() where we returned rather than continued. Not sure why. Either we must free the socklist, or continue. This patch continues on error. Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 0032d548db56eac9ea09b4ba05843365f6325b85 commit)
* | | Merge branch 'master' into jc/cache-treeJunio C Hamano2006-04-26
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: commit-tree: allow generic object name for the tree as well. Makefile: remove and create xdiff library from scratch. t0000-basic: Add ls-tree recursive test back. Libified diff-index: backward compatibility fix. Libify diff-index. Libify diff-files. Makefile: remove and create libgit.a from scratch. Document the configuration file Document git-var -l listing also configuration variables rev-parse: better error message for ambiguous arguments make update-index --chmod work with multiple files and --stdin socksetup: don't return on set_reuse_addr() error Fix "git show --stat" git-update-index --unresolve Add git-unresolve <paths>... Add colordiff for git to contrib/colordiff. gitk: Let git-rev-list do the argument list parsing
| * | commit-tree: allow generic object name for the tree as well.Junio C Hamano2006-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use get_sha1() for -p (parent) objects, but still used get_sha1_hex() for the tree. Just to be consistent, allow extended SHA1 expression for the tree object name. Note that this is not to encourage funky things like this: git-commit-tree HEAD^{tree} -p HEAD Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Makefile: remove and create xdiff library from scratch.Junio C Hamano2006-04-26
| | | | | | | | | | | | | | | | | | ... in the same spirit as 71459c193d04870076efa0a387c317390b53e3e2. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | t0000-basic: Add ls-tree recursive test back.Junio C Hamano2006-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we updated ls-tree recursive output to omit the tree nodes, 246cc52f388cae8ca99e5a12b8458c9bfa467765 adjusted the old test so that we do not expect to see trees in its output. Later, with 0f8f45cb4a7e664b396f73c25891da46b953b8b8, we added back the ability to show both with -t option, but we forgot to update the test as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Merge branch 'jc/diff'Junio C Hamano2006-04-25
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/diff: Libified diff-index: backward compatibility fix. Libify diff-index. Libify diff-files.
| | * | Libified diff-index: backward compatibility fix.Junio C Hamano2006-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "diff-index -m" does not mean "do not ignore merges", but means "pretend missing files match the index". The previous round tried to address this, but failed because setup_revisions() ate "-m" flag before the caller had a chance to intervene. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | Libify diff-index.Junio C Hamano2006-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The second installment to libify diff brothers. The pathname arguments are checked more strictly than before because we now use the revision.c::setup_revisions() infrastructure. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | Libify diff-files.Junio C Hamano2006-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first installment to libify diff brothers. The updated diff-files uses revision.c::setup_revisions() infrastructure to parse its command line arguments, which means the pathname arguments are checked more strictly than before. The tests are adjusted to separate possibly missing paths from the rest of arguments with double-dashes, to show the kosher way. As Linus pointed out, renaming diff.c to diff-lib.c was simply stupid, so I am renaming it back. The new diff-lib.c is to contain pieces extracted from diff brothers. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Makefile: remove and create libgit.a from scratch.Junio C Hamano2006-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foolishly I renamed diff.o around which caused an old diff.o taken out of libgit.a and got linked into resulting binary and exhibited mysterious breakage for many people. This borrows from the kernel Makefile (scripts/Makefile.build) to first remove the target and then recreate. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Merge branch 'fix'Junio C Hamano2006-04-24
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | * fix: Document the configuration file Document git-var -l listing also configuration variables rev-parse: better error message for ambiguous arguments
| | * | Document the configuration filePetr Baudis2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a Documentation/config.txt file included by git-repo-config and currently aggregating hopefully all the available git plumbing / core porcelain configuration variables, as well as briefly describing the format. It also updates an outdated bit of the example in git-repo-config(1). Signed-off-by: Petr Baudis <pasky@suse.cz>
| | * | Document git-var -l listing also configuration variablesPetr Baudis2006-04-24
| | | | | | | | | | | | | | | | Signed-off-by: Petr Baudis <pasky@suse.cz>
| | * | rev-parse: better error message for ambiguous argumentsPaul Mackerras2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if git-rev-parse encounters an argument that is neither a recognizable revision name nor the name of an existing file or directory, and it hasn't encountered a "--" argument, it prints an error message saying "No such file or directory". This can be confusing for users, including users of programs such as gitk that use git-rev-parse, who may then think that they can't ask about the history of files that no longer exist. This makes it print a better error message, one that points out the ambiguity and tells the user what to do to fix it. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | Merge branch 'ar/chmod-series'Junio C Hamano2006-04-24
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * ar/chmod-series: make update-index --chmod work with multiple files and --stdin
| | * | | make update-index --chmod work with multiple files and --stdinAlex Riesen2006-04-23
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | The patch makes "--chmod=-x" and "--chmod=+x" act like "--add" and "--remove" to affect the behaviour of the command for the rest of the path parameters, not just the following one. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Merge branch 'sh/daemon'Junio C Hamano2006-04-24
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * sh/daemon: socksetup: don't return on set_reuse_addr() error
| | * | | socksetup: don't return on set_reuse_addr() errorSerge E. Hallyn2006-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The set_reuse_addr() error case was the only error case in socklist() where we returned rather than continued. Not sure why. Either we must free the socklist, or continue. This patch continues on error. Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Merge branch 'jc/cc-stat'Junio C Hamano2006-04-24
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/cc-stat: Fix "git show --stat"
| | * | | | Fix "git show --stat"Junio C Hamano2006-04-21
| | | |/ / | | |/| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Merge branch 'jc/unresolve'Junio C Hamano2006-04-24
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/unresolve: git-update-index --unresolve Add git-unresolve <paths>...
| | * | | | git-update-index --unresolveJunio C Hamano2006-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retire git-unresolve and make it into "git-update-index --unresolve". It processes all paths that follow. During a merge, you would mark a path that is dealt with with: $ git update-index hello and you would "undo" it with: $ git update-index --unresolve hello Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | | | Add git-unresolve <paths>...Junio C Hamano2006-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt to address the issue raised on #git channel recently by Carl Worth. After a conflicted automerge, "git diff" shows a combined diff to give you how the tentative automerge result differs from what came from each branch. During a complex merge, it is tempting to be able to resolve a few paths at a time, mark them "I've dealt with them" with git-update-index to unclutter the next "git diff" output, and keep going. However, when the final result does not compile or otherwise found to be a mismerge, the workflow to fix the mismerged paths suddenly changes to "git diff HEAD -- path" (to get a diff from our HEAD before merging) and "git diff MERGE_HEAD -- path" (to get a diff from theirs), and it cannot show the combined anymore. With git-unresolve <paths>..., the versions from our branch and their branch for specified blobs are placed in stage #2 and stage #3, without touching the working tree files. This gives you the combined diff back for easier review, along with "diff --ours" and "diff --theirs". One thing it does not do is to place the base in stage #1; this means "diff --base" would behave differently between the run immediately after a conflicted three-way merge, and the run after an update-index by mistake followed by a git-unresolve. We could theoretically run merge-base between HEAD and MERGE_HEAD to find which tree to place in stage #1, but reviewing "diff --base" is not that useful so.... Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | Merge branch 'jc/color'Junio C Hamano2006-04-24
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/color: Add colordiff for git to contrib/colordiff.
| | * | | | | Add colordiff for git to contrib/colordiff.Junio C Hamano2006-04-21
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hacked it up to teach it the git extended diff headers, made it not to read the whole patch in the array. Also, the original program, when arguments are given, ran "diff" with the given arguments and showed the output from it. Of course, I changed it to run "git diff" ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano2006-04-24
| |\ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/gitk/gitk: gitk: Let git-rev-list do the argument list parsing
| | * | | | gitk: Let git-rev-list do the argument list parsingPaul Mackerras2006-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for a problem reported by Jim Radford where an argument list somewhere overflows on repositories with lots of tags. In fact it's now unnecessary to use git-rev-parse since git-rev-list can take all the arguments that git-rev-parse can. This is inspired by but not the same as the solutions suggested by Jim Radford and Linus Torvalds. Signed-off-by: Paul Mackerras <paulus@samba.org>
* | | | | | test-dump-cache-tree: report number of subtrees.Junio C Hamano2006-04-25
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | cache-tree: sort the subtree entries.Junio C Hamano2006-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not that this makes practical performance difference; the kernel tree for example has 200 or so directories that have subdirectory, and the largest ones have 57 of them (fs and drivers). With a test to apply 600 patches with git-apply and git-write-tree, this did not make more than one per-cent of a difference, but it is a good cleanup. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | Teach fsck-objects about cache-tree.Junio C Hamano2006-04-25
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | index: make the index file format extensible.Junio C Hamano2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and move the cache-tree data into it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | cache-tree: protect against "git prune".Junio C Hamano2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We reused the cache-tree data without verifying the tree object still exists. Recompute in cache_tree_update() an otherwise valid cache-tree entry when the tree object disappeared. This is not usually a problem, but theoretically without this fix things can break when the user does something like this: - read-index from a side branch - write-tree the result - remove the side branch with "git branch -D" - remove the unreachable objects with "git prune" - write-tree what is in the index. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | Add test-dump-cache-treeJunio C Hamano2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was useful in diagnosing the corrupt index.aux format problem. But do not bother building or installing it by default. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | Use cache-tree in update-index.Junio C Hamano2006-04-24
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>