summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2011-12-28Sync with 1.7.8.2Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-28Merge branch 'jv/maint-config-set' into maintLibravatar Junio C Hamano1-1/+1
* jv/maint-config-set: Fix an incorrect reference to --set-all.
2011-12-28Merge branch 'jc/checkout-m-twoway' into maintLibravatar Junio C Hamano1-24/+36
* jc/checkout-m-twoway: t/t2023-checkout-m.sh: fix use of test_must_fail checkout_merged(): squelch false warning from some gcc Test 'checkout -m -- path' checkout -m: no need to insist on having all 3 stages
2011-12-28Merge branch 'jk/maint-strbuf-missing-init' into maintLibravatar Junio C Hamano2-2/+2
* jk/maint-strbuf-missing-init: commit, merge: initialize static strbuf
2011-12-28Merge branch 'jn/maint-sequencer-fixes' into maintLibravatar Junio C Hamano1-48/+92
* jn/maint-sequencer-fixes: revert: stop creating and removing sequencer-old directory Revert "reset: Make reset remove the sequencer state" revert: do not remove state until sequence is finished revert: allow single-pick in the middle of cherry-pick sequence revert: pass around rev-list args in already-parsed form revert: allow cherry-pick --continue to commit before resuming revert: give --continue handling its own function
2011-12-28Merge branch 'jk/maint-mv' into maintLibravatar Junio C Hamano1-2/+4
* jk/maint-mv: mv: be quiet about overwriting mv: improve overwrite warning mv: make non-directory destination error more clear mv: honor --verbose flag docs: mention "-k" for both forms of "git mv"
2011-12-28Merge branch 'jk/fetch-no-tail-match-refs' into maintLibravatar Junio C Hamano2-7/+11
* jk/fetch-no-tail-match-refs: connect.c: drop path_match function fetch-pack: match refs exactly t5500: give fully-qualified refs to fetch-pack drop "match" parameter from get_remote_heads
2011-12-28Merge branch 'ci/stripspace-docs' into maintLibravatar Junio C Hamano1-1/+1
* ci/stripspace-docs: Update documentation for stripspace
2011-12-28Merge branch 'jn/branch-move-to-self' into maintLibravatar Junio C Hamano2-6/+20
* jn/branch-move-to-self: Allow checkout -B <current-branch> to update the current branch branch: allow a no-op "branch -M <current-branch> HEAD"
2011-12-27Fix an incorrect reference to --set-all.Libravatar Jelmer Vernooij1-1/+1
Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-22Merge branch 'ab/sun-studio-portability'Libravatar Junio C Hamano2-5/+5
* ab/sun-studio-portability: Appease Sun Studio by renaming "tmpfile" Fix a bitwise negation assignment issue spotted by Sun Studio Fix an enum assignment issue spotted by Sun Studio
2011-12-22Merge branch 'rr/revert-cherry-pick'Libravatar Junio C Hamano1-23/+25
* rr/revert-cherry-pick: t3502, t3510: clarify cherry-pick -m failure t3510 (cherry-pick-sequencer): use exit status revert: simplify getting commit subject in format_todo() revert: tolerate extra spaces, tabs in insn sheet revert: make commit subjects in insn sheet optional revert: free msg in format_todo()
2011-12-22Merge branch 'jk/maint-strbuf-missing-init'Libravatar Junio C Hamano2-2/+2
* jk/maint-strbuf-missing-init: commit, merge: initialize static strbuf Conflicts: builtin/merge.c
2011-12-22Merge branch 'rs/diff-tree-combined-clean-up'Libravatar Junio C Hamano1-6/+6
* rs/diff-tree-combined-clean-up: submodule: use diff_tree_combined_merge() instead of diff_tree_combined() pass struct commit to diff_tree_combined_merge() use struct sha1_array in diff_tree_combined()
2011-12-22Merge branch 'tr/grep-threading'Libravatar Junio C Hamano1-15/+20
* tr/grep-threading: grep: disable threading in non-worktree case grep: enable threading with -p and -W using lazy attribute lookup grep: load funcname patterns for -W
2011-12-22Merge branch 'nd/war-on-nul-in-commit'Libravatar Junio C Hamano4-6/+8
* nd/war-on-nul-in-commit: commit_tree(): refuse commit messages that contain NULs Convert commit_tree() to take strbuf as message merge: abort if fails to commit Conflicts: builtin/commit.c commit.c commit.h
2011-12-21Sync with v1.7.8.1Libravatar Junio C Hamano3-5/+3
2011-12-21Merge branch 'bc/maint-apply-check-no-patch' into maintLibravatar Junio C Hamano1-5/+5
* bc/maint-apply-check-no-patch: builtin/apply.c: report error on failure to recognize input t/t4131-apply-fake-ancestor.sh: fix broken test
2011-12-21clone: the -o option has nothing to do with <branch>Libravatar Carlos Martín Nieto1-2/+2
It is to give an alternate <name> instead of "origin" to the remote we are cloning from. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21builtin/log: remove redundant initializationLibravatar Michael Schubert1-2/+0
"abbrev" and "commit_format" in struct rev_info get initialized in init_revisions - no need to reinit in cmd_log_init_defaults. Signed-off-by: Michael Schubert <mschub@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21Merge branch 'ms/commit-cc-option-helpstring' into maintLibravatar Junio C Hamano1-1/+1
* ms/commit-cc-option-helpstring: builtin/commit: add missing '/' in help message
2011-12-21Appease Sun Studio by renaming "tmpfile"Libravatar Ævar Arnfjörð Bjarmason1-3/+3
On Solaris the system headers define the "tmpfile" name, which'll cause Git compiled with Sun Studio 12 Update 1 to whine about us redefining the name: "pack-write.c", line 76: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC) "sha1_file.c", line 2455: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC) "fast-import.c", line 858: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC) "builtin/index-pack.c", line 175: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC) Just renaming the "tmpfile" variable to "tmp_file" in the relevant places is the easiest way to fix this. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21Fix an enum assignment issue spotted by Sun StudioLibravatar Ævar Arnfjörð Bjarmason1-2/+2
In builtin/fast-export.c we'd assign to variables of the tag_of_filtered_mode enum type with constants defined for the signed_tag_mode enum. We'd get the intended value since both the value we were assigning with and the one we actually wanted had the same positional within their respective enums, but doing it this way makes no sense. This issue was spotted by Sun Studio 12 Update 1: "builtin/fast-export.c", line 54: warning: enum type mismatch: op "=" (E_ENUM_TYPE_MISMATCH_OP) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-20Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: builtin/init-db.c: eliminate -Wformat warning on Solaris
2011-12-20builtin/init-db.c: eliminate -Wformat warning on SolarisLibravatar Ævar Arnfjörð Bjarmason1-1/+1
On Solaris systems we'd warn about an implicit cast of mode_t when we printed things out with the %d format. We'd get this warning under GCC 4.6.0 with Solaris headers: builtin/init-db.c: In function ‘separate_git_dir’: builtin/init-db.c:354:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘mode_t’ [-Wformat] We've been doing this ever since v1.7.4.1-296-gb57fb80. Just work around this by adding an explicit cast. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-20Merge branch 'jc/pull-signed-tag'Libravatar Junio C Hamano1-1/+5
* jc/pull-signed-tag: commit: do not lose mergetag header when not amending
2011-12-20commit: do not lose mergetag header when not amendingLibravatar Junio C Hamano1-1/+5
The earlier ed7a42a (commit: teach --amend to carry forward extra headers, 2011-11-08) broke "git merge/pull; edit to fix conflict; git commit" workflow by forgetting that commit_tree_extended() takes the whole extra header list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-19Merge branch 'jc/checkout-m-twoway'Libravatar Junio C Hamano1-24/+36
* jc/checkout-m-twoway: checkout_merged(): squelch false warning from some gcc Test 'checkout -m -- path' checkout -m: no need to insist on having all 3 stages
2011-12-19Merge branch 'jk/fetch-no-tail-match-refs'Libravatar Junio C Hamano2-7/+11
* jk/fetch-no-tail-match-refs: connect.c: drop path_match function fetch-pack: match refs exactly t5500: give fully-qualified refs to fetch-pack drop "match" parameter from get_remote_heads
2011-12-19Merge branch 'nd/resolve-ref'Libravatar Junio C Hamano14-50/+41
* nd/resolve-ref: Rename resolve_ref() to resolve_ref_unsafe() Convert resolve_ref+xstrdup to new resolve_refdup function revert: convert resolve_ref() to read_ref_full()
2011-12-19Merge branch 'jn/maint-sequencer-fixes'Libravatar Junio C Hamano1-48/+92
* jn/maint-sequencer-fixes: revert: stop creating and removing sequencer-old directory Revert "reset: Make reset remove the sequencer state" revert: do not remove state until sequence is finished revert: allow single-pick in the middle of cherry-pick sequence revert: pass around rev-list args in already-parsed form revert: allow cherry-pick --continue to commit before resuming revert: give --continue handling its own function
2011-12-19Merge branch 'jk/maint-mv'Libravatar Junio C Hamano1-2/+4
* jk/maint-mv: mv: be quiet about overwriting mv: improve overwrite warning mv: make non-directory destination error more clear mv: honor --verbose flag docs: mention "-k" for both forms of "git mv"
2011-12-19Merge branch 'ci/stripspace-docs'Libravatar Junio C Hamano1-1/+1
* ci/stripspace-docs: Update documentation for stripspace
2011-12-19Merge branch 'tr/cache-tree'Libravatar Junio C Hamano2-4/+10
* tr/cache-tree: reset: update cache-tree data when appropriate commit: write cache-tree data when writing index anyway Refactor cache_tree_update idiom from commit Test the current state of the cache-tree optimization Add test-scrap-cache-tree
2011-12-18Update jk/maint-strbuf-missing-init to builtin/ renameLibravatar Junio C Hamano89-0/+42160
2011-12-17use struct sha1_array in diff_tree_combined()Libravatar René Scharfe1-6/+6
Maintaining an array of hashes is easier using sha1_array than open-coding it. This patch also fixes a leak of the SHA1 array in diff_tree_combined_merge(). Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-16Merge branch 'jc/commit-amend-no-edit'Libravatar Junio C Hamano1-4/+5
* jc/commit-amend-no-edit: test: commit --amend should honor --no-edit commit: honour --no-edit t7501 (commit): modernize style test: remove a porcelain test that hard-codes commit names test: add missing "&&" after echo command
2011-12-16Merge branch 'jc/stream-to-pack'Libravatar Junio C Hamano2-44/+23
* jc/stream-to-pack: bulk-checkin: replace fast-import based implementation csum-file: introduce sha1file_checkpoint finish_tmp_packfile(): a helper function create_tmp_packfile(): a helper function write_pack_header(): a helper function Conflicts: pack.h
2011-12-16Merge branch 'jk/upload-archive-use-start-command'Libravatar Junio C Hamano1-31/+12
* jk/upload-archive-use-start-command: upload-archive: use start_command instead of fork
2011-12-16grep: disable threading in non-worktree caseLibravatar Thomas Rast1-18/+18
Measurements by various people have shown that grepping in parallel is not beneficial when the object store is involved. For example, with a simple regex: Threads | --cached case | worktree case ---------------------------------------------------------------- 8 (default) | 2.88u 0.21s 0:02.94real | 0.19u 0.32s 0:00.16real 4 | 2.89u 0.29s 0:02.99real | 0.16u 0.34s 0:00.17real 2 | 2.83u 0.36s 0:02.87real | 0.18u 0.32s 0:00.26real NO_PTHREADS | 2.16u 0.08s 0:02.25real | 0.12u 0.17s 0:00.31real This happens because all the threads contend on read_sha1_mutex almost all of the time. A more complex regex allows the threads to do more work in parallel, but as Jeff King found out, the "super boost" (much higher clock when only one core is active) feature of recent CPUs still causes the unthreaded case to win by a large margin. So until the pack machinery allows unthreaded access, we disable grep's threading in all but the worktree case. Helped-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-16grep: enable threading with -p and -W using lazy attribute lookupLibravatar Thomas Rast1-4/+9
Lazily load the userdiff attributes in match_funcname(). Use a separate mutex around this loading to protect the (not thread-safe) attributes machinery. This lets us re-enable threading with -p and -W while reducing the overhead caused by looking up attributes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15revert: simplify getting commit subject in format_todo()Libravatar Ramkumar Ramachandra1-5/+5
format_todo() calls get_message(), but uses only the subject line of the commit message. As a minor optimization, save work and unnecessary memory allocations by using find_commit_subject() instead. Also, remove the unnecessary check on cur->item->buffer: the lookup_commit_reference() call in parse_insn_line() has already made sure of this. Suggested-by: Jonathan Nieder <jrnieder@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15revert: tolerate extra spaces, tabs in insn sheetLibravatar Ramkumar Ramachandra1-6/+12
Tolerate extra spaces and tabs as part of the the field separator in '.git/sequencer/todo', for people with fat fingers. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15revert: make commit subjects in insn sheet optionalLibravatar Ramkumar Ramachandra1-21/+16
Change the instruction sheet format subtly so that the subject of the commit message that follows the object name is optional. As a result, an instruction sheet like this is now perfectly valid: pick 35b0426 pick fbd5bbcbc2e pick 7362160f While at it, also fix a bug introduced by 5a5d80f4 (revert: Introduce --continue to continue the operation, 2011-08-04) that failed to read lines that are too long to fit on the commit-id-shaped buffer we currently use; eliminate the need for the buffer altogether. In addition to literal SHA-1 hexes, you can now safely use expressions like the following in the instruction sheet: featurebranch~4 rr/revert-cherry-pick-continue^2~12@{12 days ago} [jc: simplify parsing] Suggested-by: Jonathan Nieder <jrnieder@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15revert: free msg in format_todo()Libravatar Ramkumar Ramachandra1-0/+1
Memory allocated to the fields of msg by get_message() isn't freed. This is potentially a big leak, because fresh memory is allocated to store the commit message for each commit. Fix this using free_message(). Reported-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15Convert commit_tree() to take strbuf as messageLibravatar Nguyễn Thái Ngọc Duy4-6/+6
There wan't a way for commit_tree() to notice if the message the caller prepared contained a NUL byte, as it did not take the length of the message as a parameter. Use a pointer to a strbuf instead, so that we can either choose to allow low-level plumbing commands to make commits that contain NUL byte in its message, or forbid NUL everywhere by adding the check in commit_tree(), in later patches. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15merge: abort if fails to commitLibravatar Nguyễn Thái Ngọc Duy1-2/+4
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15checkout_merged(): squelch false warning from some gccLibravatar Junio C Hamano1-1/+1
gcc 4.6.2 (there may be others) does not realize that the variable "mode" can never be used uninitialized in this function and issues a false warning under -Wuninitialized option. Squelch it with an unnecessary initialization; it is not like a single assignment matters to the performance in this codepath that writes out to the filesystem with checkout_entry() anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-13Merge branch 'ks/tag-cleanup'Libravatar Junio C Hamano1-14/+53
* ks/tag-cleanup: git-tag: introduce --cleanup option Conflicts: builtin/tag.c
2011-12-13Merge branch 'bc/maint-apply-check-no-patch'Libravatar Junio C Hamano1-5/+5
* bc/maint-apply-check-no-patch: builtin/apply.c: report error on failure to recognize input t/t4131-apply-fake-ancestor.sh: fix broken test