summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-12-30grep: do not do external grep on skip-worktree entriesLibravatar Nguyễn Thái Ngọc Duy1-1/+17
Skip-worktree entries are not on disk. We cannot use external grep in such cases. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-14commit: correctly respect skip-worktree bitLibravatar Nguyễn Thái Ngọc Duy2-6/+9
Commit b4d1690 (Teach Git to respect skip-worktree bit (reading part)) fails to make "git commit -- a b c" respect skip-worktree (i.e. not committing paths that are skip-worktree). This is because when the index is reset back to HEAD, all skip-worktree information is gone. This patch saves skip-worktree information in the string list of committed paths, then reuse it later on to skip skip-worktree paths. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-14ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALIDLibravatar Nguyễn Thái Ngọc Duy5-9/+26
Previously CE_MATCH_IGNORE_VALID flag is used by both valid and skip-worktree bits. While the two bits have similar behaviour, sharing this flag means "git update-index --really-refresh" will ignore skip-worktree while it should not. Instead another flag is introduced to ignore skip-worktree bit, CE_MATCH_IGNORE_VALID only applies to valid bit. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-25tests: rename duplicate t1009Libravatar Jeff King1-0/+0
We should avoid duplicate test numbers, since things like GIT_SKIP_TESTS consider something like t1009.5 to be unambiguous. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23sparse checkout: inhibit empty worktreeLibravatar Nguyễn Thái Ngọc Duy2-7/+10
The way sparse checkout works, users may empty their worktree completely, because of non-matching sparse-checkout spec, or empty spec. I believe this is not desired. This patch makes Git refuse to produce such worktree. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Add tests for sparse checkoutLibravatar Nguyễn Thái Ngọc Duy1-0/+154
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23read-tree: add --no-sparse-checkout to disable sparse checkout supportLibravatar Nguyễn Thái Ngọc Duy2-2/+8
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack-trees(): ignore worktree check outside checkout areaLibravatar Nguyễn Thái Ngọc Duy1-0/+12
verify_absent() and verify_uptodate() are used to ensure worktree is safe to be updated, then CE_REMOVE or CE_UPDATE will be set. Finally check_updates() bases on CE_REMOVE, CE_UPDATE and the recently added CE_WT_REMOVE to update working directory accordingly. The entries that are checked may eventually be left out of checkout area (done later in apply_sparse_checkout()). We don't want to update outside checkout area. This patch teaches Git to assume "good", skip these checks when it's sure those entries will be outside checkout area, and clear CE_REMOVE|CE_UPDATE that could be set due to this assumption. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final indexLibravatar Nguyễn Thái Ngọc Duy2-1/+83
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkoutLibravatar Nguyễn Thái Ngọc Duy7-7/+48
This patch introduces core.sparseCheckout, which will control whether sparse checkout support is enabled in unpack_trees() It also loads sparse-checkout file that will be used in the next patch. I split it out so the next patch will be shorter, easier to read. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack-trees.c: generalize verify_* functionsLibravatar Nguyễn Thái Ngọc Duy1-5/+18
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack-trees(): add CE_WT_REMOVE to remove on worktree aloneLibravatar Nguyễn Thái Ngọc Duy2-1/+11
CE_REMOVE now removes both worktree and index versions. Sparse checkout must be able to remove worktree version while keep the index intact when checkout area is narrowed. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Introduce "sparse checkout"Libravatar Nguyễn Thái Ngọc Duy1-0/+44
With skip-worktree bit, you can manually set it to unwanted files, then remove them: you would have the so-called sparse checkout. The disadvantages are: - Porcelain tools are not aware of this. Everytime you do an operation that may update working directory, skip-worktree may be cleared out. You have to set them again. - You still have to remove skip-worktree'd files manually, which is boring and ineffective. These will be addressed in the following patches. This patch gives an idea what is "sparse checkout" in Documentation/git-read-tree.txt. This file is chosen instead of git-checkout.txt because it is quite technical and user-unfriendly. I'd expect git-checkout.txt to have something when Porcelain support is done. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23dir.c: export excluded_1() and add_excludes_from_file_1()Libravatar Nguyễn Thái Ngọc Duy2-16/+20
These functions are used to handle .gitignore. They are now exported so that sparse checkout can reuse. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23excluded_1(): support exclude files in indexLibravatar Nguyễn Thái Ngọc Duy1-0/+6
Index does not really have "directories", attempts to match "foo/" against index will fail unless someone tries to reconstruct directories from a list of file. Observing that dtype in this function can never be NULL (otherwise it would segfault), dtype NULL will be used to say "hey.. you are matching against index" and behave properly. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23unpack-trees(): carry skip-worktree bit over in merged_entry()Libravatar Nguyễn Thái Ngọc Duy1-0/+2
In this code path, we would remove "old" and replace it with "merge". "old" may have skip-worktree bit, so re-add it to "merge". Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Read .gitignore from index if it is skip-worktreeLibravatar Nguyễn Thái Ngọc Duy6-22/+95
This adds index as a prerequisite for directory listing (with exclude). At the moment directory listing is used by "git clean", "git add", "git ls-files" and "git status"/"git commit" and unpack_trees()-related commands. These commands have been checked/modified to populate index before doing directory listing. add_excludes_from_file() does not enable this feature, because it is used to read .git/info/exclude and some explicit files specified by "git ls-files". Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Avoid writing to buffer in add_excludes_from_file_1()Libravatar Nguyễn Thái Ngọc Duy1-3/+2
In the next patch, the buffer that is being used within add_excludes_from_file_1() comes from another function and does not have extra space to put \n at the end. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Teach Git to respect skip-worktree bit (writing part)Libravatar Nguyễn Thái Ngọc Duy2-2/+148
This part is mainly to remove CE_VALID shortcuts (and as a consequence, ce_uptodate() shortcuts as it may be turned on by CE_VALID) in writing code path if skip-worktree is used. Various tests are added to avoid future breakages. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Teach Git to respect skip-worktree bit (reading part)Libravatar Nguyễn Thái Ngọc Duy8-26/+199
grep: turn on --cached for files that is marked skip-worktree ls-files: do not check for deleted file that is marked skip-worktree update-index: ignore update request if it's skip-worktree, while still allows removing diff*: skip worktree version Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Introduce "skip-worktree" bit in index, teach Git to get/set this bitLibravatar Nguyễn Thái Ngọc Duy6-3/+109
Detail about this bit is in Documentation/git-update-index.txt. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23Add test-index-versionLibravatar Nguyễn Thái Ngọc Duy3-0/+16
Commit 06aaaa0bf70fe37d198893f4e25fa73b6516f8a9 may step index format version up and down, depends on whether extended flags present in the index. This adds a test to check for index format version. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-23update-index: refactor mark_valid() in preparation for new optionsLibravatar Nguyễn Thái Ngọc Duy1-14/+10
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-11Prevent diff machinery from examining assume-unchanged entries on worktreeLibravatar Nguyễn Thái Ngọc Duy2-2/+35
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10Merge branch 'maint'Libravatar Junio C Hamano3-5/+5
* maint: Fix typos in git-remote.txt and git-symbolic-ref.txt git-instaweb: fix mod_perl detection for apache2
2009-08-10Merge branch 'maint-1.6.3' into maintLibravatar Junio C Hamano2-4/+4
* maint-1.6.3: Fix typos in git-remote.txt and git-symbolic-ref.txt
2009-08-10Merge branch 'jk/push-quiet'Libravatar Junio C Hamano5-1/+26
* jk/push-quiet: transport: don't show push status if --quiet is given transport: pass "quiet" flag to pack-objects push: add --quiet flag
2009-08-10Merge branch 'jc/maint-merge-recursive-fix'Libravatar Junio C Hamano2-3/+80
* jc/maint-merge-recursive-fix: merge-recursive: don't segfault while handling rename clashes
2009-08-10Merge branch 'zf/maint-gitweb-acname'Libravatar Junio C Hamano1-3/+2
* zf/maint-gitweb-acname: gitweb: parse_commit_text encoding fix
2009-08-10Merge branch 'ns/am-raw-email'Libravatar Junio C Hamano2-1/+34
* ns/am-raw-email: git-am: print fair error message when format detection fails am: allow individual e-mail files as input
2009-08-10Merge branch 'np/maint-limit-delta-cache'Libravatar Junio C Hamano2-4/+12
* np/maint-limit-delta-cache: don't let the delta cache grow unbounded in 'git repack'
2009-08-10Merge branch 'jp/symlink-dirs'Libravatar Junio C Hamano4-1/+114
* jp/symlink-dirs: t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite git-checkout: be careful about untracked symlinks lstat_cache: guard against full match of length of 'name' parameter Demonstrate bugs when a directory is replaced with a symlink
2009-08-10Merge branch 'mk/grep-max-depth'Libravatar Junio C Hamano5-11/+103
* mk/grep-max-depth: grep: Add --max-depth option.
2009-08-10Merge branch 'js/run-command-updates'Libravatar Junio C Hamano11-125/+106
* js/run-command-updates: api-run-command.txt: describe error behavior of run_command functions run-command.c: squelch a "use before assignment" warning receive-pack: remove unnecessary run_status report run_command: report failure to execute the program, but optionally don't run_command: encode deadly signal number in the return value run_command: report system call errors instead of returning error codes run_command: return exit code as positive value MinGW: simplify waitpid() emulation macros
2009-08-10Fix typos in git-remote.txt and git-symbolic-ref.txtLibravatar Štěpán Němec2-4/+4
Signed-off-by: Štěpán Němec <stepnem@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10Check return value of ftruncate call in http.cLibravatar Jeff Lasslett1-1/+5
In new_http_object_request(), check ftruncate() call return value and handle possible errors. Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10http.c: replace usage of temporary variable for urlsLibravatar Tay Ray Chuan1-9/+6
Use preq->url in new_http_pack_request and freq->url in new_http_object_request when calling curl_setopt(CURLOPT_URL), instead of using an intermediate variable, 'url'. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10http.c: free preq when abortingLibravatar Tay Ray Chuan1-0/+1
Free preq in new_http_pack_request when aborting. preq was allocated before jumping to the 'abort' label so this is safe. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10Merge branch 'master' of git://git.bogomips.org/git-svnLibravatar Junio C Hamano3-5/+19
* 'master' of git://git.bogomips.org/git-svn: git-svn: ignore leading blank lines in svn:ignore svn: Honor --prefix option in init without --stdlayout svn: Add && to t9107-git-svn-migrate.sh
2009-08-10git-svn: ignore leading blank lines in svn:ignoreLibravatar Michael Haggerty2-1/+6
Subversion ignores all blank lines in svn:ignore properties. The old git-svn code ignored blank lines everywhere except for the first line of the svn:ignore property. This patch makes the "git svn show-ignore" and "git svn create-ignore" commands ignore leading blank lines, too. Also include leading blank lines in the test suite. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
2009-08-10svn: Honor --prefix option in init without --stdlayoutLibravatar Adam Brewster1-1/+2
Most users who type git svn init file:///tmp/repo --prefix=my-svn/ would expect the root of the svn repository to be tracked by refs/remotes/my-svn/git-svn. Acked-by: Eric Wong <normalperson@yhbt.net>
2009-08-10svn: Add && to t9107-git-svn-migrate.shLibravatar Adam Brewster1-3/+11
It was probably intended for the test to fail unless all of the commands succeed. [ew: fixed tests to actually work] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-09git-instaweb: fix mod_perl detection for apache2Libravatar Mark A Rada1-1/+1
The script was looking for something that matched the '^our $gitbin' regex, which no longer exists in gitweb.cgi. Now it looks for 'MOD_PERL', which should be on the line that checks to see if the script is running in a mod_perl environment. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09Document 'stash clear' recovery via unreachable commitsLibravatar Thomas Rast1-1/+16
Add an example to the stash documentation that shows how to quickly find candidate commits among the 'git fsck --unreachable' output. Unless you have merges of branch names containing WIP, or edit your merge messages to say WIP, there will be no false positives. Snippet written by Björn "doener" Steinbrink and me after zepolen_ asked on IRC. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t/Makefile: include config.makLibravatar Jeff King1-0/+2
This is useful if you want to specify GIT_TEST_OPTS that you always use. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: allow user to specify trash directory locationLibravatar Jeff King1-1/+8
The tests generate a large amount of I/O activity creating and destroying repositories and files. We can improve the time it takes to run the test suite by creating trash directories on filesystems with better performance characteristic, even though we may not want the rest of the git repository on those filesystems (e.g., because they are not network connected, or because they are temporary ramdisks). For example, on a dual processor system: $ cd t && time make -j32 real 1m51.562s user 0m59.260s sys 1m20.933s # /dev/shm is tmpfs $ cd t && time make -j32 GIT_TEST_OPTS="--root=/dev/shm" real 1m1.484s user 0m53.555s sys 1m5.264s We almost halve the wall clock time, and we utilize the dual processors much better. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: provide $TRASH_DIRECTORY variableLibravatar Jeff King2-3/+3
Most scripts don't care about the absolute path to the trash directory. The one exception was t4014 script, which pieced together $TEST_DIRECTORY and $test itself to get an absolute directory. Instead, let's provide a $TRASH_DIRECTORY which specifies the same thing. This keeps the $test variable internal to test-lib.sh and paves the way for trash directories in other locations. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: use "$TEST_DIRECTORY" instead of ".."Libravatar Jeff King4-4/+4
The $TEST_DIRECTORY variable allows tests to find the top-level test directory regardless of the current working directory. In the past, this has been used to accomodate tests which change directories, but it is also the first step to being able to move trash directories outside of the $TEST_DIRECTORY hierarchy. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t0001-init: split the existence test from the permission testLibravatar Johannes Sixt1-0/+6
The test for correct permissions after init created a deep directory must be guarded by POSIXPERM. But testing that the deep dirctory exists is good even on platforms that do not provide the POSIXPERM prerequiste. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t0001-init: fix a file nameLibravatar Johannes Sixt1-1/+1
Without this change, grep fails because it does not find the file instead of because it does not find the text in the file. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>