summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2011-07-11ref namespaces: Support remote repositories via upload-pack and receive-packLibravatar Josh Triplett1-6/+39
Change upload-pack and receive-pack to use the namespace-prefixed refs when working with the repository, and use the unprefixed refs when talking to the client, maintaining the masquerade. This allows clone, pull, fetch, and push to work with a suitably configured GIT_NAMESPACE. receive-pack advertises refs outside the current namespace as .have refs (as it currently does for refs in alternates), so that the client can use them to minimize data transfer but will otherwise ignore them. With appropriate configuration, this also allows http-backend to expose namespaces as multiple repositories with different paths. This only requires setting GIT_NAMESPACE, which http-backend passes through to upload-pack and receive-pack. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-23Merge branch 'ms/ls-remote-exit-with-status'Libravatar Junio C Hamano1-2/+9
* ms/ls-remote-exit-with-status: ls-remote: the --exit-code option reports "no matching refs"
2011-05-23Merge branch 'mg/config-symbolic-constants'Libravatar Junio C Hamano1-1/+6
* mg/config-symbolic-constants: config: Give error message when not changing a multivar config: define and document exit codes
2011-05-23Merge branch 'jc/magic-pathspec'Libravatar Junio C Hamano1-7/+1
* jc/magic-pathspec: setup.c: Fix some "symbol not declared" sparse warnings t3703: Skip tests using directory name ":" on Windows revision.c: leave a note for "a lone :" enhancement t3703, t4208: add test cases for magic pathspec rev/path disambiguation: further restrict "misspelled index entry" diag fix overslow :/no-such-string-ever-existed diagnostics fix overstrict :<path> diagnosis grep: use get_pathspec() correctly pathspec: drop "lone : means no pathspec" from get_pathspec() Revert "magic pathspec: add ":(icase)path" to match case insensitively" magic pathspec: add ":(icase)path" to match case insensitively magic pathspec: futureproof shorthand form magic pathspec: add tentative ":/path/from/top/level" pathspec support
2011-05-23Merge branch 'jk/blame-line-porcelain'Libravatar Junio C Hamano1-10/+23
* jk/blame-line-porcelain: blame: add --line-porcelain output format blame: refactor porcelain output add tests for various blame formats
2011-05-19Merge branch 'jc/replacing'Libravatar Junio C Hamano1-2/+2
* jc/replacing: read_sha1_file(): allow selective bypassing of replacement mechanism inline lookup_replace_object() calls read_sha1_file(): get rid of read_sha1_file_repl() madness t6050: make sure we test not just commit replacement Declare lookup_replace_object() in cache.h, not in commit.h Conflicts: environment.c
2011-05-19Merge branch 'ms/tagname-does-not-begin-with-dash'Libravatar Junio C Hamano1-8/+18
* ms/tagname-does-not-begin-with-dash: tag: disallow '-' as tag name
2011-05-19Merge branch 'jk/git-connection-deadlock-fix'Libravatar Junio C Hamano1-0/+2
* jk/git-connection-deadlock-fix: test core.gitproxy configuration send-pack: avoid deadlock on git:// push with failed pack-objects connect: let callers know if connection is a socket connect: treat generic proxy processes like ssh processes Conflicts: connect.c
2011-05-19Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'Libravatar Junio C Hamano1-2/+2
* js/maint-send-pack-stateless-rpc-deadlock-fix: sideband_demux(): fix decl-after-stmt
2011-05-19Merge branch 'jk/cherry-pick-root-with-resolve'Libravatar Junio C Hamano2-5/+11
* jk/cherry-pick-root-with-resolve: t3503: test cherry picking and reverting root commits revert: allow reverting a root commit cherry-pick: handle root commits with external strategies
2011-05-18ls-remote: the --exit-code option reports "no matching refs"Libravatar Michael Schubert1-2/+9
The "git ls-remote" uses its exit status to indicate if it successfully talked with the remote repository. A new option "--exit-code" makes the command exit with status "2" when there is no refs to be listed, even when the command successfully talked with the remote repository. This way, the caller can tell if we failed to contact the remote, or the remote did not have what we wanted to see. Of course, you can inspect the output from the command, which has been and will continue to be a valid way to check the same thing. Signed-off-by: Michael Schubert <mschub@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-17config: Give error message when not changing a multivarLibravatar Michael J Gruber1-1/+6
When trying to set a multivar with "git config var value", "git config" issues warning: remote.repoor.push has multiple values leaving the user under the impression that the operation succeeded, unless one checks the return value. Instead, make it warning: remote.repoor.push has multiple values error: cannot overwrite multiple values with a single value Use a regexp, --add or --set-all to change remote.repoor.push. to be clear and helpful. Note: The "warning" is raised through other code paths also so that it needs to remain a warning for these (which do not raise the error). Only the caller can determine how to go on from that. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-16Merge branch 'ci/commit--interactive-atomic'Libravatar Junio C Hamano2-15/+37
* ci/commit--interactive-atomic: Test atomic git-commit --interactive Add commit to list of config.singlekey commands Add support for -p/--patch to git-commit Allow git commit --interactive with paths t7501.8: feed a meaningful command Use a temporary index for git commit --interactive
2011-05-16Merge branch 'mg/merge-ff-config'Libravatar Junio C Hamano1-0/+9
* mg/merge-ff-config: tests: check git does not barf on merge.ff values for future versions of git merge: introduce merge.ff configuration variable Conflicts: t/t7600-merge.sh
2011-05-16revert: allow reverting a root commitLibravatar Jeff King1-3/+1
Although it is probably an uncommon operation, there is no reason to disallow it, as it works just fine. It is the reverse of a cherry-pick of a root commit, which is already allowed. We do have to tweak one check on whether we have a merge commit, which assumed we had at least one parent. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-16cherry-pick: handle root commits with external strategiesLibravatar Jeff King1-2/+10
The merge-recursive strategy already handles root commits; it cherry-picks the difference between the empty tree and the root commit's tree. However, for external strategies, we dereference NULL and segfault while building the argument list. Instead, let's handle this by passing the empty tree sha1 to the merge script. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15Merge branch 'cn/format-patch-quiet' into maintLibravatar Junio C Hamano1-6/+10
* cn/format-patch-quiet: format-patch: document --quiet option format-patch: don't pass on the --quiet flag
2011-05-15read_sha1_file(): get rid of read_sha1_file_repl() madnessLibravatar Junio C Hamano1-2/+2
Most callers want to silently get a replacement object, and they do not care what the real name of the replacement object is. Worse yet, no sane interface to return the underlying object without replacement is provided. Remove the function and make only the few callers that want the name of the replacement object find it themselves. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14Merge branch 'maint'Libravatar Junio C Hamano1-2/+2
* maint: add, merge, diff: do not use strcasecmp to compare config variable names
2011-05-14add, merge, diff: do not use strcasecmp to compare config variable namesLibravatar Jonathan Nieder1-2/+2
The config machinery already makes section and variable names lowercase when parsing them, so using strcasecmp for comparison just feels wasteful. No noticeable change intended. Noticed-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13Merge branch 'bf/commit-template-no-cleanup'Libravatar Junio C Hamano1-1/+3
* bf/commit-template-no-cleanup: Do not strip empty lines / trailing spaces from a commit message template
2011-05-13Merge branch 'rr/rerere-libify-clear-gc'Libravatar Junio C Hamano1-75/+2
* rr/rerere-libify-clear-gc: rerere: libify rerere_clear() and rerere_gc()
2011-05-13Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'Libravatar Junio C Hamano1-0/+5
* js/maint-send-pack-stateless-rpc-deadlock-fix: send-pack: unbreak push over stateless rpc send-pack: avoid deadlock when pack-object dies early
2011-05-13Merge branch 'jc/fix-add-u-unmerged'Libravatar Junio C Hamano1-22/+23
* jc/fix-add-u-unmerged: Fix "add -u" that sometimes fails to resolve unmerged paths
2011-05-13Merge branch 'cn/log-parse-opt'Libravatar Junio C Hamano1-30/+44
* cn/log-parse-opt: log: convert to parse-options
2011-05-13Merge branch 'js/blame-parsename' into maintLibravatar Junio C Hamano1-1/+1
* js/blame-parsename: t/annotate-tests: Use echo & cat instead of sed blame: tolerate bogus e-mail addresses a bit better
2011-05-11Merge branch 'jc/maint-branch-mergeoptions'Libravatar Junio C Hamano1-15/+26
* jc/maint-branch-mergeoptions: merge: make branch.<name>.mergeoptions correctly override merge.<option> Conflicts: builtin/merge.c
2011-05-11Merge branch 'jc/maint-add-p-overlapping-hunks'Libravatar Junio C Hamano1-3/+6
* jc/maint-add-p-overlapping-hunks: t3701: add-p-fix makes the last test to pass "add -p": work-around an old laziness that does not coalesce hunks add--interactive.perl: factor out repeated --recount option t3701: Editing a split hunk in an "add -p" session add -p: 'q' should really quit
2011-05-11Do not strip empty lines / trailing spaces from a commit message templateLibravatar Boris Faure1-1/+3
Templates should be just that: A form that the user fills out, and forms have blanks. If people are attached to not having extra whitespace in the editor, they can simply clean up their templates. Added test with editor adding even more whitespace. Signed-off-by: Boris Faure <billiob@gmail.com> Based-on-patch-by:Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-10grep: use get_pathspec() correctlyLibravatar Junio C Hamano1-7/+1
When there is no remaining string in argv, get_pathspec(prefix, argv) will return a two-element array that has prefix as the first element, so there is no need to re-roll that logic in the code that uses get_pathspec(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-10tag: disallow '-' as tag nameLibravatar Michael Schubert1-8/+18
Disallow '-' as tag name, as well as tag names starting with '-', as it would be cumbersome to "git checkout tags/-" because "git checkout -" is to switch to the previous branch. Add strbuf_check_tag_ref() as helper to check a refname for a tag. Signed-off-by: Michael Schubert <mschub@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09Add support for -p/--patch to git-commitLibravatar Conrad Irwin2-6/+10
The --interactive flag is already shared by git add and git commit, share the -p and --patch flags too. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09Allow git commit --interactive with pathsLibravatar Conrad Irwin1-2/+0
Make git commit --interactive feel more like git add --interactive by allowing the user to restrict the list of files they have to deal with. A test in t7501 used to ensure that this is not allowed; no need for that anymore. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09blame: add --line-porcelain output formatLibravatar Jeff King1-2/+8
This is just like --porcelain, except that we always output the commit information for each line, not just the first time it is referenced. This can make quick and dirty scripts much easier to write; see the example added to the blame documentation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09blame: refactor porcelain outputLibravatar Jeff King1-9/+16
This is in preparation for adding more porcelain output options. The three changes are: 1. emit_porcelain now receives the format option flags 2. emit_one_suspect_detail takes an optional "repeat" parameter to suppress the "show only once" behavior 3. The code for emitting porcelain suspect is factored into its own function for repeatability. There should be no functional changes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-08rerere: libify rerere_clear() and rerere_gc()Libravatar Junio C Hamano1-75/+2
This moves the two features from builtin/rerere.c to a more library-ish portion of the codebase. No behaviour change. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-08Use a temporary index for git commit --interactiveLibravatar Conrad Irwin1-8/+28
Change the behaviour of git commit --interactive so that when you abort the commit (by leaving the commit message empty) the index remains unchanged. Hitherto an aborted commit --interactive has added the selected hunks to the index regardless of whether the commit succeeded or not. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-06merge: introduce merge.ff configuration variableLibravatar Junio C Hamano1-0/+9
This variable gives the default setting for --ff, --no-ff or --ff-only options of "git merge" command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-06Merge branch 'jc/maint-branch-mergeoptions' into mg/merge-ff-configLibravatar Junio C Hamano1-15/+26
* jc/maint-branch-mergeoptions: merge: make branch.<name>.mergeoptions correctly override merge.<option>
2011-05-06Merge branch 'js/blame-parsename'Libravatar Junio C Hamano1-1/+1
* js/blame-parsename: t/annotate-tests: Use echo & cat instead of sed blame: tolerate bogus e-mail addresses a bit better
2011-05-06Merge branch 'nd/struct-pathspec'Libravatar Junio C Hamano5-17/+26
* nd/struct-pathspec: pathspec: rename per-item field has_wildcard to use_wildcard Improve tree_entry_interesting() handling code Convert read_tree{,_recursive} to support struct pathspec Reimplement read_tree_recursive() using tree_entry_interesting()
2011-05-04Merge branch 'mg/rev-list-count-cherry'Libravatar Junio C Hamano1-2/+8
* mg/rev-list-count-cherry: rev-list --count: separate count for --cherry-mark
2011-05-04Merge branch 'vr/merge-base-doc'Libravatar Junio C Hamano1-1/+2
* vr/merge-base-doc: Restructure documentation for git-merge-base. Documentation: update to git-merge-base --octopus
2011-05-04Merge branch 'jc/pack-objects-bigfile' into maintLibravatar Junio C Hamano1-2/+6
* jc/pack-objects-bigfile: Teach core.bigfilethreashold to pack-objects
2011-05-04Merge branch 'mg/reflog-with-options' into maintLibravatar Junio C Hamano1-13/+17
* mg/reflog-with-options: reflog: fix overriding of command line options t/t1411: test reflog with formats builtin/log.c: separate default and setup of cmd_log_init()
2011-05-02Merge branch 'jk/notes-ui-updates'Libravatar Junio C Hamano1-10/+0
* jk/notes-ui-updates: contrib/completion: --notes, --no-notes log/pretty-options: Document --[no-]notes and deprecate old notes options revision.c: make --no-notes reset --notes list revision.c: support --notes command-line option notes: refactor display notes default handling notes: refactor display notes extra refs field revision.c: refactor notes ref expansion notes: make expand_notes_ref globally accessible
2011-05-02Merge branch 'ab/i18n-fixup'Libravatar Junio C Hamano4-20/+32
* ab/i18n-fixup: (24 commits) i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811 i18n: use test_i18n{grep,cmp} in t7508 i18n: use test_i18ngrep in t7506 i18n: use test_i18ngrep and test_i18ncmp in t7502 i18n: use test_i18ngrep in t7501 i18n: use test_i18ncmp in t7500 i18n: use test_i18ngrep in t7201 i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110 i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060 i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014 i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507 i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200 i18n: use test_i18ngrep in lib-httpd and t2019 i18n: do not overuse C_LOCALE_OUTPUT (grep) i18n: use test_i18ncmp in t1200 and t2200 i18n: .git file is not a human readable message (t5601) i18n: do not overuse C_LOCALE_OUTPUT i18n: mark init-db messages for translation i18n: mark checkout plural warning for translation i18n: mark checkout --detach messages for translation ...
2011-05-02Merge branch 'jh/notes-add-ui'Libravatar Junio C Hamano1-3/+17
* jh/notes-add-ui: Make "git notes add" more user-friendly when there are existing notes Conflicts: builtin/notes.c
2011-04-29"add -p": work-around an old laziness that does not coalesce hunksLibravatar Junio C Hamano1-3/+6
Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02), "git add--interactive" behaves lazily and passes overlapping hunks to the underlying "git apply" without coalescing. This was partially corrected by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are still passed when the patch is edited. Teach "git apply" the --allow-overlap option that disables a safety feature that avoids misapplication of patches by not applying patches to overlapping hunks, and pass this option form "add -p" codepath. Do not even advertise the option, as this is merely a workaround, and the correct fix is to make "add -p" correctly coalesce adjacent patch hunks. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29blame: tolerate bogus e-mail addresses a bit betterLibravatar Josh Stone1-1/+1
The names and e-mails are sanitized by fmt_ident() when creating commits, so that they do not contain "<" nor ">", and the "committer" and "author" lines in the commit object will always be in the form: ("author" | "committer") name SP "<" email ">" SP timestamp SP zone When parsing the email part out, the current code looks for SP starting from the end of the email part, but the author could obfuscate the address as "author at example dot com". We should instead look for SP followed by "<", to match the logic of the side that formats these lines. Signed-off-by: Josh Stone <jistone@redhat.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>