summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* merge-recursive: don't detect renames from empty filesjk/maint-1.7.7-merge-recursive-no-rename-emptyJeff King2012-03-222-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge-recursive detects renames so that if one side modifies "foo" and the other side moves it to "bar", the modification is applied to "bar". However, our rename detection is based on content analysis, it can be wrong (i.e., two files were not intended as a rename, but just happen to have the same or similar content). This is quite rare if the files actually contain content, since two unrelated files are unlikely to have exactly the same content. However, empty files present a problem, in that there is nothing to analyze. An uninteresting placeholder file with zero bytes may or may not be related to a placeholder file with another name. The result is that adding content to an empty file may cause confusion if the other side of a merge removed it; your content may end up in another random placeholder file that was added. Let's err on the side of caution and not consider empty files as renames. This will cause a modify/delete conflict on the merge, which will let the user sort it out themselves. We could do the same thing for general diff rename detection. However, the stakes are much less high there, as we are explicitly reporting the rename to the user. It's only the automatic nature of merge-recursive that makes the result confusing. So there's not as much need for caution when just showing a diff. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make is_empty_blob_sha1 available everywhereJeff King2012-03-222-10/+13
| | | | | | | | | | The read-cache implementation defines this static function, but it is a generally useful concept in git. Let's give the empty blob the same treatment as the empty tree, providing both hex and binary forms of the sha1. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* drop casts from users EMPTY_TREE_SHA1_BINJeff King2012-03-222-2/+2
| | | | | | | | | | This macro already evaluates to the correct type, as it casts the string literal to "unsigned char *" itself (and callers who want the literal can use the _LITERAL form). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Document the --histogram diff optionThomas Rast2012-03-061-0/+3
| | | | | Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Sync with 1.7.6.6Junio C Hamano2012-02-052-24/+2
|\ | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Git 1.7.6.6v1.7.6.6maint-1.7.6Junio C Hamano2012-02-052-2/+3
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * imap-send: remove dead codeJeff King2012-02-051-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The imap-send code was adapted from another project, and still contains many unused bits of code. One of these bits contains a type "struct string_list" which bears no resemblence to the "struct string_list" we use elsewhere in git. This causes the compiler to complain if git's string_list ever becomes part of cache.h. Let's just drop the dead code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Git 1.7.7.6v1.7.7.6Junio C Hamano2012-01-182-1/+5
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | diff-index: enable recursive pathspec matching in unpack_treesNguyen Thai Ngoc Duy2012-01-182-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pathspec structure has a few bits of data to drive various operation modes after we unified the pathspec matching logic in various codepaths. For example, max_depth field is there so that "git grep" can limit the output for files found in limited depth of tree traversal. Also in order to show just the surface level differences in "git diff-tree", recursive field stops us from descending into deeper level of the tree structure when it is set to false, and this also affects pathspec matching when we have wildcards in the pathspec. The diff-index has always wanted the recursive behaviour, and wanted to match pathspecs without any depth limit. But we forgot to do so when we updated tree_entry_interesting() logic to unify the pathspec matching logic. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Update draft release notes to 1.7.7.6Junio C Hamano2012-01-121-0/+5
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2012-01-122-2/+12
|\ \ | |/ | | | | | | | | * maint-1.7.6: Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
| * Update draft release notes to 1.7.6.6Junio C Hamano2012-01-121-0/+5
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * thin-pack: try harder to use preferred base objects as baseJeff King2012-01-121-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a pack using objects that reside in existing packs, we try to avoid recomputing futile delta between an object (trg) and a candidate for its base object (src) if they are stored in the same packfile, and trg is not recorded as a delta already. This heuristics makes sense because it is likely that we tried to express trg as a delta based on src but it did not produce a good delta when we created the existing pack. As the pack heuristics prefer producing delta to remove data, and Linus's law dictates that the size of a file grows over time, we tend to record the newest version of the file as inflated, and older ones as delta against it. When creating a thin-pack to transfer recent history, it is likely that we will try to send an object that is recorded in full, as it is newer. But the heuristics to avoid recomputing futile delta effectively forbids us from attempting to express such an object as a delta based on another object. Sending an object in full is often more expensive than sending a suboptimal delta based on other objects, and it is even more so if we could use an object we know the receiving end already has (i.e. preferred base object) as the delta base. Tweak the recomputation avoidance logic, so that we do not punt on computing delta against a preferred base object. The effect of this change can be seen on two simulated upload-pack workloads. The first is based on 44 reflog entries from my git.git origin/master reflog, and represents the packs that kernel.org sent me git updates for the past month or two. The second workload represents much larger fetches, going from git's v1.0.0 tag to v1.1.0, then v1.1.0 to v1.2.0, and so on. The table below shows the average generated pack size and the average CPU time consumed for each dataset, both before and after the patch: dataset | reflog | tags --------------------------------- before | 53358 | 2750977 size after | 32398 | 2668479 change | -39% | -3% --------------------------------- before | 0.18 | 1.12 CPU after | 0.18 | 1.15 change | +0% | +3% This patch makes a much bigger difference for packs with a shorter slice of history (since its effect is seen at the boundaries of the pack) though it has some benefit even for larger packs. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2012-01-112-1/+2
|\ \ | |/ | | | | | | | | * maint-1.7.6: attr: fix leak in free_attr_elem t2203: fix wrong commit command
| * attr: fix leak in free_attr_elemJeff King2012-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | This function frees the individual "struct match_attr"s we have allocated, but forgot to free the array holding their pointers, leading to a minor memory leak (but it can add up after checking attributes for paths in many directories). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * t2203: fix wrong commit commandNguyễn Thái Ngọc Duy2012-01-111-1/+1
| | | | | | | | | | | | | | | | Add commit message to avoid commit's aborting due to the lack of commit message, not because there are INTENT_TO_ADD entries in index. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Prepare for 1.7.7.6Junio C Hamano2012-01-102-1/+12
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge the attributes fix in from maint-1.6.6 branchJunio C Hamano2012-01-104-33/+66
|\ \ | |/ | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Prepare for 1.7.6.6Junio C Hamano2012-01-102-1/+12
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Documentation: rerere's rr-cache auto-creation and rerere.enabledJunio C Hamano2012-01-101-1/+2
| | | | | | | | | | | | | | | | The description of rerere.enabled left the user in the dark as to who might create an rr-cache directory. Add a note that simply invoking rerere does this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * attr.c: clarify the logic to pop attr_stackJunio C Hamano2012-01-101-1/+10
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * attr.c: make bootstrap_attr_stack() leave earlyJunio C Hamano2012-01-101-30/+31
| | | | | | | | | | | | | | Thas would de-dent the body of a function that has grown rather large over time, making it a bit easier to read. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * attr: drop misguided defensive codingJeff King2012-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In prepare_attr_stack, we pop the old elements of the stack (which were left from a previous lookup and may or may not be useful to us). Our loop to do so checks that we never reach the top of the stack. However, the code immediately afterwards will segfault if we did actually reach the top of the stack. Fortunately, this is not an actual bug, since we will never pop all of the stack elements (we will always keep the root gitattributes, as well as the builtin ones). So the extra check in the loop condition simply clutters the code and makes the intent less clear. Let's get rid of it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * attr: don't confuse prefixes with leading directoriesJeff King2012-01-102-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we prepare the attribute stack for a lookup on a path, we start with the cached stack from the previous lookup (because it is common to do several lookups in the same directory hierarchy). So the first thing we must do in preparing the stack is to pop any entries that point to directories we are no longer interested in. For example, if our stack contains gitattributes for: foo/bar/baz foo/bar foo but we want to do a lookup in "foo/bar/bleep", then we want to pop the top element, but retain the others. To do this we walk down the stack from the top, popping elements that do not match our lookup directory. However, the test do this simply checked strncmp, meaning we would mistake "foo/bar/baz" as a leading directory of "foo/bar/baz_plus". We must also check that the character after our match is '/', meaning we matched the whole path component. There are two special cases to consider: 1. The top of our attr stack has the empty path. So we must not check for '/', but rather special-case the empty path, which always matches. 2. Typically when matching paths in this way, you would also need to check for a full string match (i.e., the character after is '\0'). We don't need to do so in this case, though, because our path string is actually just the directory component of the path to a file (i.e., we know that it terminates with "/", because the filename comes after that). Helped-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2012-01-061-4/+4
|\ \ | |/ | | | | | | * maint-1.7.6: Documentation: rerere.enabled is the primary way to configure rerere
| * Documentation: rerere.enabled is the primary way to configure rerereThomas Rast2012-01-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | The wording seems to suggest that creating the directory is needed and the setting of rerere.enabled is only for disabling the feature by setting it to 'false'. But the configuration is meant to be the primary control and setting it to 'true' will enable it; the rr-cache directory will be created as necessary and the user does not have to create it. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2012-01-032-5/+5
|\ \ | |/ | | | | | | | | * maint-1.7.6: Documentation: read-tree --prefix works with existing subtrees Add MYMETA.json to perl/.gitignore
| * Documentation: read-tree --prefix works with existing subtreesClemens Buchacher2012-01-011-5/+4
| | | | | | | | | | | | | | | | | | Since 34110cd4 (Make 'unpack_trees()' have a separate source and destination index) it is no longer true that a subdirectory with the same prefix must not exist. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Add MYMETA.json to perl/.gitignoreJack Nagel2011-12-291-0/+1
| | | | | | | | | | | | | | | | | | ExtUtils::MakeMaker generates MYMETA.json in addition to MYMETA.yml since version 6.57_07. As it suggests, it is just meta information about the build and is cleaned up with 'make clean', so it should be ignored. Signed-off-by: Jack Nagel <jacknagel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | docs: describe behavior of relative submodule URLsJens Lehmann2012-01-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | Since the relative submodule URLs have been introduced in f31a522a2d, they do not conform to the rules for resolving relative URIs but rather to those of relative directories. Document that behavior. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Git 1.7.7.5v1.7.7.5Junio C Hamano2011-12-134-3/+21
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ab/clang-lints' into maint-1.7.7Junio C Hamano2011-12-133-5/+2
|\ \ | | | | | | | | | | | | | | | * ab/clang-lints: cast variable in call to free() in builtin/diff.c and submodule.c apply: get rid of useless x < 0 comparison on a size_t type
| * | cast variable in call to free() in builtin/diff.c and submodule.cab/clang-lintsÆvar Arnfjörð Bjarmason2011-11-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both of these free() calls are freeing a "const unsigned char (*)[20]" type while free() expects a "void *". This results in the following warning under clang 2.9: builtin/diff.c:185:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers free(parent); ^~~~~~ submodule.c:394:7: warning: passing 'const unsigned char (*)[20]' to parameter of type 'void *' discards qualifiers free(parents); ^~~~~~~ This free()-ing without a cast was added by Jim Meyering to builtin/diff.c in v1.7.6-rc3~4 and later by Fredrik Gustafsson in submodule.c in v1.7.7-rc1~25^2. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | apply: get rid of useless x < 0 comparison on a size_t typeÆvar Arnfjörð Bjarmason2011-11-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the C standard size_t is always unsigned, therefore the comparison "n1 < 0 || n2 < 0" when n1 and n2 are size_t will always be false. This was raised by clang 2.9 which throws this warning when compiling apply.c: builtin/apply.c:253:9: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (n1 < 0 || n2 < 0) ~~ ^ ~ builtin/apply.c:253:19: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (n1 < 0 || n2 < 0) ~~ ^ ~ This check was originally added in v1.6.5-rc0~53^2 by Giuseppe Bilotta while adding an option to git-apply to ignore whitespace differences. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'nd/maint-ignore-exclude' into maint-1.7.7Junio C Hamano2011-12-132-2/+2
|\ \ \ | | | | | | | | | | | | | | | | * nd/maint-ignore-exclude: checkout,merge: loosen overwriting untracked file check based on info/exclude
| * | | checkout,merge: loosen overwriting untracked file check based on info/excludend/maint-ignore-excludeNguyễn Thái Ngọc Duy2011-11-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 1127148 (Loosen "working file will be lost" check in Porcelain-ish - 2006-12-04), git-checkout.sh learned to quietly overwrite ignored files. Howver the code only took .gitignore files into account. Standard ignored files include all specified in .gitignore files in working directory _and_ $GIT_DIR/info/exclude. This patch makes sure ignored files in info/exclude can also be overwritten automatically in the spirit of the original patch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2011-12-134-40/+78
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-1.7.6: Git 1.7.6.5 blame: don't overflow time buffer fetch: create status table using strbuf Conflicts: Documentation/git.txt GIT-VERSION-GEN RelNotes
| * | | Git 1.7.6.5v1.7.6.5Junio C Hamano2011-12-134-3/+30
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'jk/maint-fetch-status-table' into maint-1.7.6Junio C Hamano2011-12-131-38/+49
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * jk/maint-fetch-status-table: fetch: create status table using strbuf
| | * | | fetch: create status table using strbufjk/maint-fetch-status-tableJeff King2011-12-091-38/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we fetch from a remote, we print a status table like: From url * [new branch] foo -> origin/foo We create this table in a static buffer using sprintf. If the remote refnames are long, they can overflow this buffer and smash the stack. Instead, let's use a strbuf to build the string. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Merge branch 'jc/maint-name-rev-all' into maint-1.7.6Junio C Hamano2011-12-131-1/+1
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-name-rev-all: name-rev --all: do not even attempt to describe non-commit object
| * \ \ \ \ Merge branch 'ml/mailmap' into maint-1.7.6Junio C Hamano2011-12-131-3/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ml/mailmap: mailmap: xcalloc mailmap_info Conflicts: mailmap.c
| * | | | | | blame: don't overflow time bufferJeff King2011-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing the raw timestamp, we format the numeric seconds-since-epoch into a buffer, followed by the timezone string. This string has come straight from the commit object. A well-formed object should have a timezone string of only a few bytes, but we could be operating on data pushed by a malicious user. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | am: don't persist keepcr flagMartin von Zweigbergk2011-12-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The keepcr flag is only used in the split_patches function, which is only called before a patch application has to stopped for user input, not after resuming. It is therefore unnecessary to persist the flag. This seems to have been the case since it was introduced in ad2c928 (git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit, 2010-02-27). Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | mingw: give waitpid the correct signatureErik Faye-Lund2011-12-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX says that last parameter to waitpid should be 'int', so let's make it so. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | git symbolic-ref: documentation fixMichael Haggerty2011-12-081-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old "git symbolic-ref" manpage seemed to imply in one place that symlinks are still the default way to represent symbolic references and in another that symlinks are deprecated. Fix the text and shorten the justification for the change of implementation. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano2011-12-052-2/+1
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-1.7.6: stripspace: fix outdated comment Add MYMETA.yml to perl/.gitignore
| * | | | | | stripspace: fix outdated commentJeff King2011-12-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment on top of stripspace() claims that the buffer will no longer be NUL-terminated. However, this has not been the case at least since the move to using strbuf in 2007. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | Add MYMETA.yml to perl/.gitignoreSebastian Morr2011-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file is auto-generated by newer versions of ExtUtils::MakeMaker (presumably starting with the version shipping with Perl 5.14). It just contains extra information about the environment and arguments to the Makefile-building process, and should be ignored. Signed-off-by: Sebastian Morr <sebastian@morr.cc> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | documentation fix: git difftool uses diff tools, not merge tools.Thomas Hochstein2011-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the documentation for -t list valid *diff* tools, not valid *merge* tools. Signed-off-by: Thomas Hochstein <thh@inter.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>