summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2011-10-05Merge branch 'jc/receive-verify'Libravatar Junio C Hamano2-56/+57
* jc/receive-verify: receive-pack: check connectivity before concluding "git push" check_everything_connected(): libify check_everything_connected(): refactor to use an iterator fetch: verify we have everything we need before updating our ref Conflicts: builtin/fetch.c
2011-10-05Merge branch 'jc/fetch-verify'Libravatar Junio C Hamano3-60/+77
* jc/fetch-verify: fetch: verify we have everything we need before updating our ref rev-list --verify-object list-objects: pass callback data to show_objects()
2011-10-05Merge branch 'jc/fetch-pack-fsck-objects'Libravatar Junio C Hamano2-4/+33
* jc/fetch-pack-fsck-objects: test: fetch/receive with fsckobjects transfer.fsckobjects: unify fetch/receive.fsckobjects fetch.fsckobjects: verify downloaded objects Conflicts: Documentation/config.txt builtin/fetch-pack.c
2011-10-05Merge branch 'jc/traverse-commit-list'Libravatar Junio C Hamano1-15/+2
* jc/traverse-commit-list: revision.c: update show_object_with_name() without using malloc() revision.c: add show_object_with_name() helper function rev-list: fix finish_object() call
2011-10-05Merge branch 'rr/revert-cherry-pick-continue'Libravatar Junio C Hamano1-154/+583
* rr/revert-cherry-pick-continue: builtin/revert.c: make commit_list_append() static revert: Propagate errors upwards from do_pick_commit revert: Introduce --continue to continue the operation revert: Don't implicitly stomp pending sequencer operation revert: Remove sequencer state when no commits are pending reset: Make reset remove the sequencer state revert: Introduce --reset to remove sequencer state revert: Make pick_commits functionally act on a commit list revert: Save command-line options for continuing operation revert: Save data for continuing after conflict resolution revert: Don't create invalid replay_opts in parse_args revert: Separate cmdline parsing from functional code revert: Introduce struct to keep command-line options revert: Eliminate global "commit" variable revert: Rename no_replay to record_origin revert: Don't check lone argument in get_encoding revert: Simplify and inline add_message_to_msg config: Introduce functions to write non-standard file advice: Introduce error_resolve_conflict
2011-10-05Merge branch 'ms/patch-id-with-overlong-line'Libravatar Junio C Hamano1-4/+6
* ms/patch-id-with-overlong-line: patch-id.c: use strbuf instead of a fixed buffer
2011-10-05Merge branch 'jc/maint-bundle-too-quiet'Libravatar Junio C Hamano1-1/+1
* jc/maint-bundle-too-quiet: Teach progress eye-candy to fetch_refs_from_bundle()
2011-10-05Merge branch 'jc/want-commit'Libravatar Junio C Hamano1-5/+14
* jc/want-commit: Allow git merge ":/<pattern>"
2011-10-05Merge branch 'jc/maint-fsck-fwrite-size-check'Libravatar Junio C Hamano1-6/+3
* jc/maint-fsck-fwrite-size-check: fsck: do not abort upon finding an empty blob
2011-10-05Merge branch 'nm/grep-object-sha1-lock'Libravatar Junio C Hamano1-0/+3
* nm/grep-object-sha1-lock: grep: Fix race condition in delta_base_cache Conflicts: builtin/grep.c
2011-09-22patch-id.c: use strbuf instead of a fixed bufferLibravatar Michael Schubert1-4/+6
get_one_patchid() uses a rather dumb heuristic to determine if the passed buffer is part of the next commit. Whenever the first 40 bytes are a valid hexadecimal sha1 representation, get_one_patchid() returns next_sha1. Once the current line is longer than the fixed buffer, this will break (provided the additional bytes make a valid hexadecimal sha1). As a result patch-id returns incorrect results. Instead, use strbuf and read one line at a time. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Michael Schubert <mschub@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-19Teach progress eye-candy to fetch_refs_from_bundle()Libravatar Junio C Hamano1-1/+1
With the usual "git" transport, a large-ish transfer with "git fetch" and "git pull" give progress eye-candy to avoid boring users. However, not when they are reading from a bundle. I.e. $ git pull ../git-bundle.bndl master This teaches bundle.c:unbundle() to give "-v" option to index-pack and tell it to give progress bar when transport decides it is necessary. The operation in the other direction, "git bundle create", could also learn to honor --quiet but that is a separate issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-16Merge branch 'ci/forbid-unwanted-current-branch-update'Libravatar Junio C Hamano2-2/+3
* ci/forbid-unwanted-current-branch-update: branch --set-upstream: regression fix
2011-09-16branch --set-upstream: regression fixLibravatar Junio C Hamano2-2/+3
The "git branch" command, while not in listing mode, calls create_branch() even when the target branch already exists, and it does so even when it is not interested in updating the value of the branch (i.e. the name of the commit object that sits at the tip of the existing branch). This happens when the command is run with "--set-upstream" option. The earlier safety-measure to prevent "git branch -f $branch $commit" from updating the currently checked out branch did not take it into account, and we no longer can update the tracking information of the current branch. Minimally fix this regression by telling the validation code if it is called to really update the value of a potentially existing branch, or if the caller merely is interested in updating auxiliary aspects of a branch. Reported-and-Tested-by: Jay Soffian Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-15Allow git merge ":/<pattern>"Libravatar Junio C Hamano1-5/+14
It probably is not such a good idea to use ":/<pattern>" to specify which commit to merge, as ":/<pattern>" can often hit unexpected commits, but somebody tried it and got a nonsense error message: fatal: ':/Foo bar' does not point to a commit So here is a for-the-sake-of-consistency update that is fairly useless that allows users to carefully try not shooting in the foot. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-14Merge branch 'ph/format-patch-no-color'Libravatar Junio C Hamano1-1/+2
* ph/format-patch-no-color: format-patch: ignore ui.color
2011-09-12format-patch: ignore ui.colorLibravatar Pang Yan Han1-1/+2
commit c9bfb953 (want_color: automatically fallback to color.ui, 2011-08-17) introduced a regression where format-patch produces colorized patches when color.ui is set to "always". In f3aafa4 (Disable color detection during format-patch, 2006-07-09), git_format_config was taught to intercept diff.color to avoid passing it down to git_log_config and later, git_diff_ui_config. Teach git_format_config to intercept color.ui in the same way. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-12Sync with 1.7.6.3Libravatar Junio C Hamano1-6/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-12Merge branch 'jl/maint-fetch-submodule-check-fix' into maintLibravatar Junio C Hamano1-6/+9
* jl/maint-fetch-submodule-check-fix: fetch: skip on-demand checking when no submodules are configured
2011-09-11Merge branch 'ms/reflog-show-is-default' into maintLibravatar Junio C Hamano1-2/+1
* ms/reflog-show-is-default: reflog: actually default to subcommand 'show'
2011-09-11Merge branch 'jk/reset-reflog-message-fix' into maintLibravatar Junio C Hamano1-33/+16
* jk/reset-reflog-message-fix: reset: give better reflog messages
2011-09-11Merge branch 'jk/tag-contains-ab' (early part) into maintLibravatar Junio C Hamano1-1/+45
* 'jk/tag-contains-ab' (early part): tag: speed up --contains calculation
2011-09-11fsck: do not abort upon finding an empty blobLibravatar Junio C Hamano1-6/+3
Asking fwrite() to write one item of size bytes results in fwrite() reporting "I wrote zero item", when size is zero. Instead, we could ask it to write "size" items of 1 byte and expect it to report that "I wrote size items" when it succeeds, with any value of size, including zero. Noticed and reported by BJ Hargrave. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-11builtin/revert.c: make commit_list_append() staticLibravatar Junio C Hamano1-2/+2
There is nobody outside that calls into this helper function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-09receive-pack: check connectivity before concluding "git push"Libravatar Junio C Hamano1-0/+43
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-09check_everything_connected(): libifyLibravatar Junio C Hamano1-65/+1
Extract the helper function and the type definition of the iterator function it uses out of builtin/fetch.c into a separate source and a header file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-09check_everything_connected(): refactor to use an iteratorLibravatar Junio C Hamano1-14/+36
We will be using the same "rev-list --verify-objects" logic to add a sanity check to the receiving end of "git push" in the same way, but the list of commits that are checked come from a structure with a different shape over there. Update the function to take an iterator to make it easier to reuse it in different contexts. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-09fetch: verify we have everything we need before updating our refLibravatar Junio C Hamano1-56/+63
The "git fetch" command works in two phases. The remote side tells us what objects are at the tip of the refs we are fetching from, and transfers the objects missing from our side. After storing the objects in our repository, we update our remote tracking branches to point at the updated tips of the refs. A broken or malicious remote side could send a perfectly well-formed pack data during the object transfer phase, but there is no guarantee that the given data actually fill the gap between the objects we originally had and the refs we are updating to. Although this kind of breakage can be caught by running fsck after a fetch, it is much cheaper to verify that everything that is reachable from the tips of the refs we fetched are indeed fully connected to the tips of our current set of refs before we update them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-09fetch: skip on-demand checking when no submodules are configuredLibravatar Jens Lehmann1-6/+9
It makes no sense to do the - possibly very expensive - call to "rev-list <new-ref-sha1> --not --all" in check_for_new_submodule_commits() when there aren't any submodules configured. Leave check_for_new_submodule_commits() early when no name <-> path mappings for submodules are found in the configuration. To make that work reading the configuration had to be moved further up in cmd_fetch(), as doing that after the actual fetch of the superproject was too late. Reported-by: Martin Fick <mfick@codeaurora.org> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Merge branch 'mh/check-ref-format-print-normalize'Libravatar Junio C Hamano1-3/+3
* mh/check-ref-format-print-normalize: Forbid DEL characters in reference names check-ref-format --print: Normalize refnames that start with slashes
2011-09-06Sync with 1.7.6.2Libravatar Junio C Hamano2-21/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Revert "Merge branch 'cb/maint-quiet-push' into maint"Libravatar Junio C Hamano2-21/+4
This reverts commit ffa69e61d3c5730bd4b65a465efc130b0ef3c7df, reversing changes made to 4a13c4d14841343d7caad6ed41a152fee550261d. Adding a new command line option to receive-pack and feed it from send-pack is not an acceptable way to add features, as there is no guarantee that your updated send-pack will be talking to updated receive-pack. New features need to be added via the capability mechanism negotiated over the protocol. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-04transfer.fsckobjects: unify fetch/receive.fsckobjectsLibravatar Junio C Hamano2-5/+26
This single variable can be used to set instead of setting fsckobjects variable for fetch & receive independently. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-04fetch.fsckobjects: verify downloaded objectsLibravatar Junio C Hamano1-0/+8
This corresponds to receive.fsckobjects configuration variable added (a lot) earlier in 20dc001 (receive-pack: allow using --strict mode for unpacking objects, 2008-02-25). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-02Merge branch 'jc/clean-exclude-doc'Libravatar Junio C Hamano1-2/+3
* jc/clean-exclude-doc: Documentation: clarify "git clean -e <pattern>"
2011-09-02Merge branch 'fg/submodule-ff-check-before-push'Libravatar Junio C Hamano1-0/+19
* fg/submodule-ff-check-before-push: push: Don't push a repository with unpushed submodules
2011-09-01fetch: verify we have everything we need before updating our refLibravatar Junio C Hamano1-56/+63
The "git fetch" command works in two phases. The remote side tells us what objects are at the tip of the refs we are fetching from, and transfers the objects missing from our side. After storing the objects in our repository, we update our remote tracking branches to point at the updated tips of the refs. A broken or malicious remote side could send a perfectly well-formed pack data during the object transfer phase, but there is no guarantee that the given data actually fill the gap between the objects we originally had and the refs we are updating to. Although this kind of breakage can be caught by running fsck after a fetch, it is much cheaper to verify that everything that is reachable from the tips of the refs we fetched are indeed fully connected to the tips of our current set of refs before we update them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-01rev-list --verify-objectLibravatar Junio C Hamano1-0/+4
Often we want to verify everything reachable from a given set of commits are present in our repository and connected without a gap to the tips of our refs. We used to do this for this purpose: $ rev-list --objects $commits_to_be_tested --not --all Even though this is good enough for catching missing commits and trees, we show the object name but do not verify their existence, let alone their well-formedness, for the blob objects at the leaf level. Add a new "--verify-object" option so that we can catch missing and broken blobs as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-01list-objects: pass callback data to show_objects()Libravatar Junio C Hamano2-4/+10
The traverse_commit_list() API takes two callback functions, one to show commit objects, and the other to show other kinds of objects. Even though the former has a callback data parameter, so that the callback does not have to rely on global state, the latter does not. Give the show_objects() callback the same callback data parameter. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-28Documentation: clarify "git clean -e <pattern>"Libravatar Junio C Hamano1-2/+3
The current explanation of -e can be misread as allowing the user to say I know 'git clean -XYZ' (substitute -XYZ with any option and/or parameter) will remove paths A, B, and C, and I want them all removed except for paths matching this pattern by adding '-e C' to the same command line, i.e. 'git clean -e C -XYZ'. But that is not what this option does. It augments the set of ignore rules from the command line, just like the same "-e <pattern>" argument does with the "ls-files" command (the user could probably pass "-e \!C" to tell the command to clean everything the command would normally remove, except for C). Also error out when both -x and -e are given with an explanation of what -e means---it is a symptom of misunderstanding what -e does. It also fixes small style nit in the parameter to add_exclude() call. The current code only works because EXC_CMDL happens to be defined as 0. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-28Merge branch 'nd/decorate-grafts'Libravatar Junio C Hamano1-0/+30
* nd/decorate-grafts: log: Do not decorate replacements with --no-replace-objects log: decorate "replaced" on to replaced commits log: decorate grafted commits with "grafted" Move write_shallow_commits to fetch-pack.c Add for_each_commit_graft() to iterate all grafts decoration: do not mis-decorate refs with same prefix
2011-08-28Merge branch 'nd/maint-clone-gitdir'Libravatar Junio C Hamano2-2/+19
* nd/maint-clone-gitdir: clone: allow to clone from .git file read_gitfile_gently(): rename misnamed function to read_gitfile()
2011-08-28Merge branch 'ci/forbid-unwanted-current-branch-update'Libravatar Junio C Hamano2-14/+4
* ci/forbid-unwanted-current-branch-update: Show interpreted branch name in error messages Prevent force-updating of the current branch
2011-08-28Merge branch 'jc/maint-clone-alternates'Libravatar Junio C Hamano1-29/+90
* jc/maint-clone-alternates: clone: clone from a repository with relative alternates clone: allow more than one --reference Conflicts: builtin/clone.c
2011-08-28Merge branch 'jk/color-and-pager'Libravatar Junio C Hamano8-63/+19
* jk/color-and-pager: want_color: automatically fallback to color.ui diff: don't load color config in plumbing config: refactor get_colorbool function color: delay auto-color decision until point of use git_config_colorbool: refactor stdout_is_tty handling diff: refactor COLOR_DIFF from a flag into an int setup_pager: set GIT_PAGER_IN_USE t7006: use test_config helpers test-lib: add helper functions for config t7006: modernize calls to unset Conflicts: builtin/commit.c parse-options.c
2011-08-28Merge branch 'nk/branch-v-abbrev'Libravatar Junio C Hamano1-1/+4
* nk/branch-v-abbrev: branch -v: honor core.abbrev
2011-08-25Merge branch 'jc/merge-reword'Libravatar Junio C Hamano1-1/+1
* jc/merge-reword: merge: reword the final message
2011-08-25Merge branch 'jc/maint-autofix-tag-in-head'Libravatar Junio C Hamano1-42/+45
* jc/maint-autofix-tag-in-head: commit: reduce use of redundant global variables
2011-08-25Merge branch 'jn/plug-empty-tree-leak'Libravatar Junio C Hamano1-6/+1
* jn/plug-empty-tree-leak: merge-recursive: take advantage of hardcoded empty tree revert: plug memory leak in "cherry-pick root commit" codepath
2011-08-25Merge branch 'ac/describe-dirty-refresh'Libravatar Junio C Hamano1-2/+15
* ac/describe-dirty-refresh: describe: Refresh the index when run with --dirty