summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-10-15mergetool: don't require a work tree for --tool-helpCharles Bailey
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15git-sh-setup: move GIT_DIR initialization into a functionDavid Aguilar
Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15mergetool: use more conservative temporary filenamesDavid Aguilar
Avoid filenames with multiple dots so that overly-picky tools do not misinterpret their extension. Previously, foo/bar.ext in the worktree would result in e.g. ./foo/bar.ext.BASE.1234.ext This can be improved by having only a single .ext and using underscore instead of dot so that the extension cannot be misinterpreted. The resulting path becomes: ./foo/bar_BASE_1234.ext Suggested-by: Sergio Ferrero <sferrero@ensoftcorp.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15test-lib-functions: adjust style to match CodingGuidelinesDavid Aguilar
Prefer "test" over "[ ]" for conditionals. Prefer "$()" over backticks for command substitutions. Avoid control structures on a single line with semicolons. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15t7610-mergetool: prefer test_config over git configDavid Aguilar
Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15t7610-mergetool: add missing && and remove commented-out codeDavid Aguilar
Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-15t7610-mergetool: use tabs instead of a mix of tabs and spacesDavid Aguilar
Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-07Merge branch 'maint-1.9' into maint-2.0Junio C Hamano
* maint-1.9: git-tag.txt: Add a missing hyphen to `-s`
2014-10-07Merge branch 'maint-1.8.5' into maint-1.9Junio C Hamano
* maint-1.8.5: git-tag.txt: Add a missing hyphen to `-s`
2014-10-07git-tag.txt: Add a missing hyphen to `-s`Wieland Hoffmann
Signed-off-by: Wieland Hoffmann <themineo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-30Git 2.0.4v2.0.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-30commit --amend: test specifies authorship but forgets to checkFabian Ruch
The test case "--amend option copies authorship" specifies that the git-commit option `--amend` uses the authorship of the replaced commit for the new commit. Add the omitted check that this property actually holds. Signed-off-by: Fabian Ruch <bafain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28t4013: test diff-tree's --stdin commit formattingJeff King
Once upon a time, git-log was just "rev-list | diff-tree", and we did not bother to test it separately. These days git-log is implemented internally, but we want to make sure that the rev-list to diff-tree pipeline continues to function. Let's add a basic sanity test. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28Merge branch 'jk/alloc-commit-id-maint' into maintJunio C Hamano
* jk/alloc-commit-id-maint: diff-tree: avoid lookup_unknown_object object_as_type: set commit index alloc: factor out commit index add object_as_type helper for casting objects parse_object_buffer: do not set object type move setting of object->type to alloc_* functions alloc: write out allocator definitions alloc.c: remove the alloc_raw_commit_node() function
2014-07-28diff-tree: avoid lookup_unknown_objectJeff King
We generally want to avoid lookup_unknown_object, because it results in allocating more memory for the object than may be strictly necessary. In this case, it is used to check whether we have an already-parsed object before calling parse_object, to save us from reading the object from disk. Using lookup_object would be fine for that purpose, but we can take it a step further. Since this code was written, parse_object already learned the "check lookup_object" optimization, so we can simply call parse_object directly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28object_as_type: set commit indexJeff King
The point of the "index" field of struct commit is that every allocated commit would have one. It is supposed to be an invariant that whenever object->type is set to OBJ_COMMIT, we have a unique index. Commit 969eba6 (commit: push commit_index update into alloc_commit_node, 2014-06-10) covered this case for newly-allocated commits. However, we may also allocate an "unknown" object via lookup_unknown_object, and only later convert it to a commit. We must make sure that we set the commit index when we switch the type field. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28alloc: factor out commit indexJeff King
We keep a static counter to set the commit index on newly allocated objects. However, since we also need to set the index on any_objects which are converted to commits, let's make the counter available as a public function. While we're moving it, let's make sure the counter is allocated as an unsigned integer to match the index field in "struct commit". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28add object_as_type helper for casting objectsJeff King
When we call lookup_commit, lookup_tree, etc, the logic goes something like: 1. Look for an existing object struct. If we don't have one, allocate and return a new one. 2. Double check that any object we have is the expected type (and complain and return NULL otherwise). 3. Convert an object with type OBJ_NONE (from a prior call to lookup_unknown_object) to the expected type. We can encapsulate steps 2 and 3 in a helper function which checks whether we have the expected object type, converts OBJ_NONE as appropriate, and returns the object. Not only does this shorten the code, but it also provides one central location for converting OBJ_NONE objects into objects of other types. Future patches will use that to enforce type-specific invariants. Since this is a refactoring, we would want it to behave exactly as the current code. It takes a little reasoning to see that this is the case: - for lookup_{commit,tree,etc} functions, we are just pulling steps 2 and 3 into a function that does the same thing. - for the call in peel_object, we currently only do step 3 (but we want to consolidate it with the others, as mentioned above). However, step 2 is a noop here, as the surrounding conditional makes sure we have OBJ_NONE (which we want to keep to avoid an extraneous call to sha1_object_info). - for the call in lookup_commit_reference_gently, we are currently doing step 2 but not step 3. However, step 3 is a noop here. The object we got will have just come from deref_tag, which must have figured out the type for each object in order to know when to stop peeling. Therefore the type will never be OBJ_NONE. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28parse_object_buffer: do not set object typeJeff King
The only way that "obj" can be non-NULL is if it came from one of the lookup_* functions. These functions always ensure that the object has the expected type (and return NULL otherwise), so there is no need for us to set the type. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28move setting of object->type to alloc_* functionsJeff King
The "struct object" type implements basic object polymorphism. Individual instances are allocated as concrete types (or as a union type that can store any object), and a "struct object *" can be cast into its real type after examining its "type" enum. This means it is dangerous to have a type field that does not match the allocation (e.g., setting the type field of a "struct blob" to "OBJ_COMMIT" would mean that a reader might read past the allocated memory). In most of the current code this is not a problem; the first thing we do after allocating an object is usually to set its type field by passing it to create_object. However, the virtual commits we create in merge-recursive.c do not ever get their type set. This does not seem to have caused problems in practice, though (presumably because we always pass around a "struct commit" pointer and never even look at the type). We can fix this oversight and also make it harder for future code to get it wrong by setting the type directly in the object allocation functions. This will also make it easier to fix problems with commit index allocation, as we know that any object allocated by alloc_commit_node will meet the invariant that an object with an OBJ_COMMIT type field will have a unique index number. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28alloc: write out allocator definitionsJeff King
Because the allocator functions for tree, blobs, etc are all very similar, we originally used a macro to avoid repeating ourselves. Since the prior commit, though, the heavy lifting is done by an inline helper function. The macro does still save us a few lines, but at some readability cost. It obfuscates the function definitions (and makes them hard to find via grep). Much worse, though, is the fact that it isn't used consistently for all allocators. Somebody coming later may be tempted to modify DEFINE_ALLOCATOR, but they would miss alloc_commit_node, which is treated specially. Let's just drop the macro and write everything out explicitly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-28alloc.c: remove the alloc_raw_commit_node() functionRamsay Jones
In order to encapsulate the setting of the unique commit index, commit 969eba63 ("commit: push commit_index update into alloc_commit_node", 10-06-2014) introduced a (logically private) intermediary allocator function. However, this function (alloc_raw_commit_node()) was declared as a public function, which undermines its entire purpose. Introduce an inline function, alloc_node(), which implements the main logic of the allocator used by DEFINE_ALLOCATOR, and redefine the macro in terms of the new function. In addition, use the new function in the implementation of the alloc_commit_node() allocator, rather than the intermediary allocator, which can now be removed. Noticed by sparse ("symbol 'alloc_raw_commit_node' was not declared. Should it be static?"). Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-23Git 2.0.3v2.0.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-23.mailmap: combine Stefan Beller's emailsStefan Beller
Google mail has had the extension @googlemail.com for a long time in Germany as @gmail.de was already taken by a competitor. Nowadays the original gmail company isn't there anymore(?), hence Googlemail also introduced @gmail.com in Germany, which I switched to. This changed mail address of mine first appeared in 398dd4bd039680b (2014-07-10, .mailmap: map different names with the same email address together) ironically. Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-23git.1: switch homepage for statsStefan Beller
According to http://meta.ohloh.net/2014/07/black-duck-open-hub/ the site name of ohloh changed to openhub. Change the man page accordingly. Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-22Merge branch 'ah/fix-http-push' into maintJunio C Hamano
* ah/fix-http-push: http-push.c: make CURLOPT_IOCTLDATA a usable pointer
2014-07-22Merge branch 'po/error-message-style' into maintJunio C Hamano
* po/error-message-style: doc: give some guidelines for error messages
2014-07-22Merge branch 'zk/log-graph-showsig' into maintJunio C Hamano
* zk/log-graph-showsig: log: fix indentation for --graph --show-signature
2014-07-22Merge branch 'mg/fix-log-mergetag-color' into maintJunio C Hamano
* mg/fix-log-mergetag-color: log: correctly identify mergetag signature verification status
2014-07-22Merge branch 'cb/filter-branch-prune-empty-degenerate-merges' into maintJunio C Hamano
* cb/filter-branch-prune-empty-degenerate-merges: filter-branch: eliminate duplicate mapped parents
2014-07-22Merge branch 'ye/doc-http-proto' into maintJunio C Hamano
* ye/doc-http-proto: http-protocol.txt: Basic Auth is defined in RFC 2617, not RFC 2616
2014-07-22Merge branch 'jm/api-strbuf-doc' into maintJunio C Hamano
* jm/api-strbuf-doc: api-strbuf.txt minor typos
2014-07-22Merge branch 'jm/dedup-test-config' into maintJunio C Hamano
* jm/dedup-test-config: t/t7810-grep.sh: remove duplicate test_config()
2014-07-22Merge branch 'sk/test-cmp-bin' into maintJunio C Hamano
* sk/test-cmp-bin: t5000, t5003: do not use test_cmp to compare binary files
2014-07-22Merge branch 'jm/doc-wording-tweaks' into maintJunio C Hamano
* jm/doc-wording-tweaks: Documentation: wording fixes in the user manual and glossary
2014-07-22Merge branch 'jm/instaweb-apache-24' into maintJunio C Hamano
* jm/instaweb-apache-24: git-instaweb: add support for Apache 2.4
2014-07-22Merge branch 'bg/xcalloc-nmemb-then-size' into maintJunio C Hamano
* bg/xcalloc-nmemb-then-size: transport-helper.c: rearrange xcalloc arguments remote.c: rearrange xcalloc arguments reflog-walk.c: rearrange xcalloc arguments pack-revindex.c: rearrange xcalloc arguments notes.c: rearrange xcalloc arguments imap-send.c: rearrange xcalloc arguments http-push.c: rearrange xcalloc arguments diff.c: rearrange xcalloc arguments config.c: rearrange xcalloc arguments commit.c: rearrange xcalloc arguments builtin/remote.c: rearrange xcalloc arguments builtin/ls-remote.c: rearrange xcalloc arguments
2014-07-22Merge branch 'cb/byte-order' into maintJunio C Hamano
* cb/byte-order: compat/bswap.h: fix endianness detection compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN compat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER
2014-07-22Merge branch 'lt/request-pull' into maintJunio C Hamano
* lt/request-pull: fix brown paper bag breakage in t5150-request-pull.sh
2014-07-22Merge branch 'ep/shell-assign-and-export-vars' into maintJunio C Hamano
* ep/shell-assign-and-export-vars: scripts: more "export VAR=VALUE" fixes scripts: "export VAR=VALUE" construct is not portable
2014-07-22Merge branch 'maint-1.9' into maintJunio C Hamano
* maint-1.9: Documentation: fix missing text for rev-parse --verify
2014-07-22Merge branch 'maint-1.8.5' into maint-1.9Junio C Hamano
* maint-1.8.5: Documentation: fix missing text for rev-parse --verify
2014-07-22Documentation: fix missing text for rev-parse --verifybrian m. carlson
The caret (^) is used as a markup symbol in AsciiDoc. Due to the inability of AsciiDoc to parse a line containing an unmatched caret, it omitted the line from the output, resulting in the man page missing the end of a sentence. Escape this caret so that the man page ends up with the complete text. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21use xmemdupz() to allocate copies of strings given by start and lengthRené Scharfe
Use xmemdupz() to allocate the memory, copy the data and make sure to NUL-terminate the result, all in one step. The resulting code is shorter, doesn't contain the constants 1 and '\0', and avoids duplicating function parameters. For blame, the last copied byte (o->file.ptr[o->file.size]) is always set to NUL by fake_working_tree_commit() or read_sha1_file(), so no information is lost by the conversion to using xmemdupz(). Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21use xcalloc() to allocate zero-initialized memoryRené Scharfe
Use xcalloc() instead of xmalloc() followed by memset() to allocate and zero out memory because it's shorter and avoids duplicating the function parameters. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-16Git 2.0.2v2.0.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-16Merge branch 'jc/fix-clone-single-starting-at-a-tag' into maintJunio C Hamano
"git clone -b brefs/tags/bar" would have mistakenly thought we were following a single tag, even though it was a name of the branch, because it incorrectly used strstr(). * jc/fix-clone-single-starting-at-a-tag: builtin/clone.c: detect a clone starting at a tag correctly
2014-07-16Merge branch 'jk/pretty-G-format-fixes' into maintJunio C Hamano
"%G" (nothing after G) is an invalid pretty format specifier, but the parser did not notice it as garbage. * jk/pretty-G-format-fixes: move "%G" format test from t7510 to t6006 pretty: avoid reading past end-of-string with "%G" t7510: check %G* pretty-format output t7510: test a commit signed by an unknown key t7510: use consistent &&-chains in loop t7510: stop referring to master in later tests
2014-07-16Merge branch 'rs/fix-alt-odb-path-comparison' into maintJunio C Hamano
Code to avoid adding the same alternate object store twice was subtly broken for a long time, but nobody seems to have noticed. * rs/fix-alt-odb-path-comparison: sha1_file: avoid overrunning alternate object base string
2014-07-16Merge branch 'jk/commit-buffer-length' into maintJunio C Hamano
A handful of code paths had to read the commit object more than once when showing header fields that are usually not parsed. The internal data structure to keep track of the contents of the commit object has been updated to reduce the need for this double-reading, and to allow the caller find the length of the object. * jk/commit-buffer-length: reuse cached commit buffer when parsing signatures commit: record buffer length in cache commit: convert commit->buffer to a slab commit-slab: provide a static initializer use get_commit_buffer everywhere convert logmsg_reencode to get_commit_buffer use get_commit_buffer to avoid duplicate code use get_cached_commit_buffer where appropriate provide helpers to access the commit buffer provide a helper to set the commit buffer provide a helper to free commit buffer sequencer: use logmsg_reencode in get_message logmsg_reencode: return const buffer do not create "struct commit" with xcalloc commit: push commit_index update into alloc_commit_node alloc: include any-object allocations in alloc_report replace dangerous uses of strbuf_attach commit_tree: take a pointer/len pair rather than a const strbuf