summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2008-11-16Merge branch 'bc/maint-keep-pack'Libravatar Junio C Hamano1-3/+15
* bc/maint-keep-pack: repack: only unpack-unreachable if we are deleting redundant packs
2008-11-16Merge branch 'jk/commit-v-strip'Libravatar Junio C Hamano1-1/+1
* jk/commit-v-strip: status: show "-v" diff even for initial commit wt-status: refactor initial commit printing define empty tree sha1 as a macro
2008-11-14repack: only unpack-unreachable if we are deleting redundant packsLibravatar Brandon Casey1-3/+15
The -A option calls pack-objects with the --unpack-unreachable option so that the unreachable objects in local packs are left in the local object store loose. But if the -d option to repack was _not_ used, then these unpacked loose objects are redundant and unnecessary. Update tests in t7701. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-13Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano2-0/+89
* git://git.bogomips.org/git-svn: git-svn: proper detection of bare repositories git-svn: respect i18n.commitencoding config git-svn: don't escape tilde ('~') for http(s) URLs
2008-11-12Merge branch 'jk/maint-commit-v-strip'Libravatar Junio C Hamano1-0/+73
* jk/maint-commit-v-strip: commit: Fix stripping of patch in verbose mode.
2008-11-12Merge branch 'np/pack-safer'Libravatar Junio C Hamano2-8/+91
* np/pack-safer: t5303: fix printf format string for portability t5303: work around printf breakage in dash pack-objects: don't leak pack window reference when splitting packs extend test coverage for latest pack corruption resilience improvements pack-objects: allow "fixing" a corrupted pack without a full repack make find_pack_revindex() aware of the nasty world make check_object() resilient to pack corruptions make packed_object_info() resilient to pack corruptions make unpack_object_header() non fatal better validation on delta base object offsets close another possibility for propagating pack corruption
2008-11-12Merge branch 'mk/maint-cg-push'Libravatar Junio C Hamano1-0/+50
* mk/maint-cg-push: git push: Interpret $GIT_DIR/branches in a Cogito compatible way Conflicts: t/t5516-fetch-push.sh
2008-11-12Merge branch 'bc/maint-keep-pack'Libravatar Junio C Hamano1-0/+73
* bc/maint-keep-pack: t7700: test that 'repack -a' packs alternate packed objects pack-objects: extend --local to mean ignore non-local loose objects too sha1_file.c: split has_loose_object() into local and non-local counterparts t7700: demonstrate mishandling of loose objects in an alternate ODB builtin-gc.c: use new pack_keep bitfield to detect .keep file existence repack: do not fall back to incremental repacking with [-a|-A] repack: don't repack local objects in packs with .keep file pack-objects: new option --honor-pack-keep packed_git: convert pack_local flag into a bitfield and add pack_keep t7700: demonstrate mishandling of objects in packs with a .keep file
2008-11-12Merge branch 'mv/remote-rename'Libravatar Junio C Hamano1-0/+48
* mv/remote-rename: git-remote: document the migration feature of the rename subcommand git-remote rename: migrate from remotes/ and branches/ remote: add a new 'origin' variable to the struct Implement git remote rename
2008-11-12Merge branch 'jk/deny-push-to-current'Libravatar Junio C Hamano1-29/+58
* jk/deny-push-to-current: receive-pack: detect push to current branch of non-bare repo t5516: refactor oddball tests
2008-11-12Merge branch 'jk/diff-convfilter'Libravatar Junio C Hamano2-5/+21
* jk/diff-convfilter: enable textconv for diff in verbose status/commit wt-status: load diff ui config only textconv regular files userdiff: require explicitly allowing textconv refactor userdiff textconv code Conflicts: t/t4030-diff-textconv.sh
2008-11-12Merge branch 'jk/diff-convfilter-test-fix'Libravatar Junio C Hamano5-6/+124
* jk/diff-convfilter-test-fix: Avoid using non-portable `echo -n` in tests. add userdiff textconv tests document the diff driver textconv feature diff: add missing static declaration Conflicts: Documentation/gitattributes.txt
2008-11-12Merge branch 'st/tag'Libravatar Junio C Hamano1-0/+11
* st/tag: tag: Add more tests about mixing incompatible modes and options tag: Check that options are only allowed in the appropriate mode
2008-11-12t7700: test that 'repack -a' packs alternate packed objectsLibravatar Brandon Casey1-0/+16
Previously, when 'repack -a' was called and there were no packs in the local repository without a .keep file, the repack would fall back to calling pack-objects with '--unpacked --incremental'. This resulted in the created pack file, if any, to be missing the packed objects in the alternate object store. Test that this specific case has been fixed. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12Merge branch 'maint'Libravatar Junio C Hamano1-0/+6
* maint: Start 1.6.0.5 cycle Fix pack.packSizeLimit and --max-pack-size handling checkout: Fix "initial checkout" detection Remove the period after the git-check-attr summary Conflicts: RelNotes
2008-11-12Fix pack.packSizeLimit and --max-pack-size handlingLibravatar Nicolas Pitre1-0/+6
If the limit was sufficiently low, having a single object written could bust the limit (by design), but caused the remaining allowed size to go negative for subsequent objects, which for an unsigned variable is a rather huge limit. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12status: show "-v" diff even for initial commitLibravatar Jeff King1-1/+1
Since we can use the same "diff against empty tree" trick as we do for the non-initial case, it is trivial to make this work. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12Merge branch 'jk/maint-commit-v-strip' into jk/commit-v-stripLibravatar Junio C Hamano1-0/+73
* jk/maint-commit-v-strip: commit: Fix stripping of patch in verbose mode.
2008-11-12commit: Fix stripping of patch in verbose mode.Libravatar Jeff King1-0/+73
When the "-v" option is given, we put diff of what is to be committed into the commit template, and then strip it back out again after the user has edited it. We used to look for the diff by searching for the "diff --git a/" header. With diff.mnemonicprefix set in the configuration, however, this pattern does not match. The pattern is loosened to cover this case. Also, if the user puts their own diff in the message (e.g., as a sample output), then we will accidentally trigger the pattern, removing part of their output. We can avoid doing this stripping altogether if the user didn't use "-v" in the first place, so we know that any match we find will be a false positive. [jc: this fix was split out of a series originally meant for master.] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12pack-objects: extend --local to mean ignore non-local loose objects tooLibravatar Brandon Casey1-1/+1
With this patch, --local means pack only local objects that are not already packed. Additionally, this fixes t7700 testing whether loose objects in an alternate object database are repacked. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12t7700: demonstrate mishandling of loose objects in an alternate ODBLibravatar Brandon Casey1-0/+19
Loose objects residing in an alternate object database should not be packed when the -l option to repack is used. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12repack: don't repack local objects in packs with .keep fileLibravatar Brandon Casey1-1/+1
If the user created a .keep file for a local pack, then it can be inferred that the user does not want those objects repacked. This fixes the repack bug tested by t7700. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12t7700: demonstrate mishandling of objects in packs with a .keep fileLibravatar Brandon Casey1-0/+38
Objects residing in pack files that have an associated .keep file are not supposed to be repacked into new pack files, but they are. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-11git-remote rename: migrate from remotes/ and branches/Libravatar Miklos Vajna1-0/+33
Remote definition that came from $GIT_DIR/remotes/nick and $GIT_DIR/branches/nick are migrated to [remotes "nick"] section in the configuration file. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-11git push: Interpret $GIT_DIR/branches in a Cogito compatible wayLibravatar Martin Koegler1-0/+50
Current git versions ignore everything after # (called <head> in the following) when pushing. Older versions (before cf818348f1ab57), interpret #<head> as part of the URL, which make git bail out. As branches origin from Cogito, it is the best to correct this by using the behaviour of cg-push, that is to push HEAD to remote refs/heads/<head>. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09t5303: fix printf format string for portabilityLibravatar Junio C Hamano1-1/+1
printf "\x01" is bad; write printf "\001" for portability. Testing with dash is a good way to find this kind of POSIX.1 violation breakages. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09t5303: work around printf breakage in dashLibravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09Merge branch 'maint'Libravatar Junio C Hamano1-0/+18
* maint: Documentation: bisect: change a few instances of "git-cmd" to "git cmd" Documentation: rev-list: change a few instances of "git-cmd" to "git cmd" checkout: Don't crash when switching away from an invalid branch.
2008-11-09receive-pack: detect push to current branch of non-bare repoLibravatar Jeff King1-0/+37
Pushing into the currently checked out branch of a non-bare repository can be dangerous; the HEAD then loses sync with the index and working tree, and it looks in the receiving repo as if the pushed changes have been reverted in the index (since they were never there in the first place). This patch adds a safety valve that checks for this condition and either generates a warning or denies the update. We trigger the check only on a non-bare repository, since a bare repo does not have a working tree (and in fact, pushing to the HEAD branch is a common workflow for publishing repositories). The behavior is configurable via receive.denyCurrentBranch, defaulting to "warn" so as not to break existing setups (though it may, after a deprecation period, switch to "refuse" by default). For users who know what they are doing and want to silence the warning (e.g., because they have a post-receive hook that reconciles the HEAD and working tree), they can turn off the warning by setting it to false or "ignore". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09t5516: refactor oddball testsLibravatar Jeff King1-29/+21
t5516 sets up some utility functions for starting each test with a clean slate. However, there were a few tests added that do not use these functions, but instead make their own repositories. Let's bring these in line with the rest of the tests. Not only do we reduce the number of lines, but these tests will benefit from any further enhancements to the utility scripts. The conversion is pretty straightforward. Most of the tests created a parent/child clone relationship, for which we now use 'testrepo' as the parent. One test looked in testrepo, but relied on previous tests to have set it up; it now sets up testrepo explicitly, which makes it a bit more robust to changes in the script, as well. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09checkout: Don't crash when switching away from an invalid branch.Libravatar Alexandre Julliard1-0/+18
When using alternates, it is possible for HEAD to end up pointing to an invalid commit. git checkout should be able to recover from that situation without crashing. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-08Merge branch 'maint'Libravatar Junio C Hamano2-0/+38
* maint: GIT 1.6.0.4 Update RPM spec for the new location of git-cvsserver. push: fix local refs update if already up-to-date do not force write of packed refs Conflicts: builtin-revert.c
2008-11-08Merge branch 'cb/maint-update-ref-fix' into maintLibravatar Junio C Hamano2-0/+38
* cb/maint-update-ref-fix: push: fix local refs update if already up-to-date do not force write of packed refs
2008-11-08Merge branch 'mv/maint-branch-m-symref' into maintLibravatar Junio C Hamano2-0/+27
* mv/maint-branch-m-symref: update-ref --no-deref -d: handle the case when the pointed ref is packed git branch -m: forbid renaming of a symref Fix git update-ref --no-deref -d. rename_ref(): handle the case when the reflog of a ref does not exist Fix git branch -m for symrefs.
2008-11-08t5400: expect success for denying deletionLibravatar Jeff King1-1/+1
Commit a240de11 introduced this test and the code to make it successful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-06git-svn: proper detection of bare repositoriesLibravatar Deskin Miller1-0/+9
When in a bare repository (or .git, for that matter), git-svn would fail to initialise properly, since git rev-parse --show-cdup would not output anything. However, git rev-parse --show-cdup actually returns an error code if it's really not in a git directory. Fix the issue by checking for an explicit error from git rev-parse, and setting $git_dir appropriately if instead it just does not output. Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-11-06git-svn: respect i18n.commitencoding configLibravatar Eric Wong1-0/+80
SVN itself always stores log messages in the repository as UTF-8. git always stores/retrieves everything as raw binary data with no transformations whatsoever. To interact with SVN, we need to encode log messages as UTF-8 before sending them to SVN, as SVN cannot do it for us. When retrieving log messages from SVN, we also need to (attempt to) reencode the UTF-8 log message back to the user-specified commit encoding. Note, handling i18n.logoutputencoding for "git svn log" also needs to be done in a future change. Also, this change only deals with the encoding of commit messages and nothing else (path names, blob content, ...). In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com> James North <tocapicha@gmail.com> wrote: > Hi, > > I'm using git-svn on a system with ISO-8859-1 encoding. The problem is > when I try to use "git svn dcommit" to send changes to a remote svn > (also ISO-8859-1). > > Seems like git-svn is sending commit messages with utf-8 (just a > guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a > de cami?\243n" > > I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the > warning when doing "git svn dcommit" but messages still are sent with > wrong encoding. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-11-05push: fix local refs update if already up-to-dateLibravatar Clemens Buchacher1-0/+31
git push normally updates local refs only after a successful push. If the remote already has the updates -- pushed indirectly through another repository, for example -- we forget to update local tracking refs. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-05do not force write of packed refsLibravatar Clemens Buchacher1-0/+7
We force writing a ref if it does not exist. Originally, we only had to look for the ref file to check if it existed. Now we have to look for a packed ref as well. Luckily, resolve_ref already does all the work for us. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-05Implement git remote renameLibravatar Miklos Vajna1-0/+15
The new rename subcommand does the followings: 1) Renames the remote.foo configuration section to remote.bar 2) Updates the remote.bar.fetch refspecs 3) Updates the branch.*.remote settings 4) Renames the tracking branches: renames the normal refs and rewrites the symrefs to point to the new refs. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-05Merge branch 'mv/maint-branch-m-symref'Libravatar Junio C Hamano2-0/+27
* mv/maint-branch-m-symref: update-ref --no-deref -d: handle the case when the pointed ref is packed git branch -m: forbid renaming of a symref Fix git update-ref --no-deref -d. rename_ref(): handle the case when the reflog of a ref does not exist Fix git branch -m for symrefs.
2008-11-04tag: Add more tests about mixing incompatible modes and optionsLibravatar Samuel Tardieu1-0/+11
Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02Merge branch 'np/index-pack'Libravatar Junio C Hamano1-27/+65
* np/index-pack: index-pack: don't leak leaf delta result improve index-pack tests fix multiple issues in index-pack index-pack: smarter memory usage during delta resolution index-pack: rationalize delta resolution code
2008-11-02Merge branch 'sh/rebase-i-p'Libravatar Junio C Hamano1-0/+135
* sh/rebase-i-p: git-rebase--interactive.sh: comparision with == is bashism rebase-i-p: minimum fix to obvious issues rebase-i-p: if todo was reordered use HEAD as the rewritten parent rebase-i-p: do not include non-first-parent commits touching UPSTREAM rebase-i-p: only list commits that require rewriting in todo rebase-i-p: fix 'no squashing merges' tripping up non-merges rebase-i-p: delay saving current-commit to REWRITTEN if squashing rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD rebase-i-p: test to exclude commits from todo based on its parents
2008-11-02Merge branch 'ag/blame-encoding'Libravatar Junio C Hamano4-0/+98
* ag/blame-encoding: builtin-blame: Reencode commit messages according to git-log rules.
2008-11-02extend test coverage for latest pack corruption resilience improvementsLibravatar Nicolas Pitre1-7/+89
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02close another possibility for propagating pack corruptionLibravatar Nicolas Pitre1-1/+2
Abstract -------- With index v2 we have a per object CRC to allow quick and safe reuse of pack data when repacking. This, however, doesn't currently prevent a stealth corruption from being propagated into a new pack when _not_ reusing pack data as demonstrated by the modification to t5302 included here. The Context ----------- The Git database is all checksummed with SHA1 hashes. Any kind of corruption can be confirmed by verifying this per object hash against corresponding data. However this can be costly to perform systematically and therefore this check is often not performed at run time when accessing the object database. First, the loose object format is entirely compressed with zlib which already provide a CRC verification of its own when inflating data. Any disk corruption would be caught already in this case. Then, packed objects are also compressed with zlib but only for their actual payload. The object headers and delta base references are not deflated for obvious performance reasons, however this leave them vulnerable to potentially undetected disk corruptions. Object types are often validated against the expected type when they're requested, and deflated size must always match the size recorded in the object header, so those cases are pretty much covered as well. Where corruptions could go unnoticed is in the delta base reference. Of course, in the OBJ_REF_DELTA case, the odds for a SHA1 reference to get corrupted so it actually matches the SHA1 of another object with the same size (the delta header stores the expected size of the base object to apply against) are virtually zero. In the OBJ_OFS_DELTA case, the reference is a pack offset which would have to match the start boundary of a different base object but still with the same size, and although this is relatively much more "probable" than in the OBJ_REF_DELTA case, the probability is also about zero in absolute terms. Still, the possibility exists as demonstrated in t5302 and is certainly greater than a SHA1 collision, especially in the OBJ_OFS_DELTA case which is now the default when repacking. Again, repacking by reusing existing pack data is OK since the per object CRC provided by index v2 guards against any such corruptions. What t5302 failed to test is a full repack in such case. The Solution ------------ As unlikely as this kind of stealth corruption can be in practice, it certainly isn't acceptable to propagate it into a freshly created pack. But, because this is so unlikely, we don't want to pay the run time cost associated with extra validation checks all the time either. Furthermore, consequences of such corruption in anything but repacking should be rather visible, and even if it could be quite unpleasant, it still has far less severe consequences than actively creating bad packs. So the best compromize is to check packed object CRC when unpacking objects, and only during the compression/writing phase of a repack, and only when not streaming the result. The cost of this is minimal (less than 1% CPU time), and visible only with a full repack. Someone with a stats background could provide an objective evaluation of this, but I suspect that it's bad RAM that has more potential for data corruptions at this point, even in those cases where this extra check is not performed. Still, it is best to prevent a known hole for corruption when recreating object data into a new pack. What about the streamed pack case? Well, any client receiving a pack must always consider that pack as untrusty and perform full validation anyway, hence no such stealth corruption could be propagated to remote repositoryes already. It is therefore worthless doing local validation in that case. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02Merge branch 'js/maint-fetch-update-head' into maintLibravatar Junio C Hamano5-3/+27
* js/maint-fetch-update-head: pull: allow "git pull origin $something:$current_branch" into an unborn branch Fix fetch/pull when run without --update-head-ok
2008-11-02Merge branch 'jk/maint-ls-files-other' into maintLibravatar Junio C Hamano1-0/+6
* jk/maint-ls-files-other: refactor handling of "other" files in ls-files and status
2008-11-02Merge branch 'jc/maint-reset-remove-unmerged-new' into maintLibravatar Junio C Hamano1-0/+60
* jc/maint-reset-remove-unmerged-new: reset --hard/read-tree --reset -u: remove unmerged new paths