summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2012-03-07show: use streaming API for showing blobsLibravatar Nguyễn Thái Ngọc Duy1-14/+20
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-07cat-file: use streaming API to print blobsLibravatar Nguyễn Thái Ngọc Duy1-0/+25
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04Merge branch 'jk/symbolic-ref-short'Libravatar Junio C Hamano1-3/+8
* jk/symbolic-ref-short: symbolic-ref --short: abbreviate the output unambiguously
2012-03-01Merge branch 'cb/fsck-squelch-dangling'Libravatar Junio C Hamano1-2/+5
* cb/fsck-squelch-dangling: fsck: --no-dangling omits "dangling object" information
2012-03-01Merge branch 'rs/no-no-no-parseopt'Libravatar Junio C Hamano2-6/+3
* rs/no-no-no-parseopt: parse-options: remove PARSE_OPT_NEGHELP parse-options: allow positivation of options starting, with no- test-parse-options: convert to OPT_BOOL() Conflicts: builtin/grep.c
2012-03-01Merge branch 'nd/maint-verify-objects'Libravatar Junio C Hamano1-22/+16
* nd/maint-verify-objects: rev-list: fix --verify-objects --quiet becoming --objects rev-list: remove BISECT_SHOW_TRIED flag
2012-03-01Merge branch 'cn/maint-branch-with-bad'Libravatar Junio C Hamano1-0/+4
* cn/maint-branch-with-bad: branch: don't assume the merge filter ref exists Conflicts: t/t3200-branch.sh
2012-02-28fsck: --no-dangling omits "dangling object" informationLibravatar Junio C Hamano1-2/+5
The default output from "fsck" is often overwhelmed by informational message on dangling objects, especially if you do not repack often, and a real error can easily be buried. Add "--no-dangling" option to omit them, and update the user manual to demonstrate its use. Based on a patch by Clemens Buchacher, but reverted the part to change the default to --no-dangling, which is unsuitable for the first patch. The usual three-step procedure to break the backward compatibility over time needs to happen on top of this, if we were to go in that direction. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28parse-options: remove PARSE_OPT_NEGHELPLibravatar René Scharfe2-5/+3
PARSE_OPT_NEGHELP is confusing because short options defined with that flag do the opposite of what the helptext says. It is also not needed anymore now that options starting with no- can be negated by removing that prefix. Convert its only two users to OPT_NEGBIT() and OPT_BOOL() and then remove support for PARSE_OPT_NEGHELP. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28rev-list: fix --verify-objects --quiet becoming --objectsLibravatar Nguyễn Thái Ngọc Duy1-11/+15
When --quiet is specified, finish_object() is called instead of show_object(). The latter is in charge of --verify-objects and will be skipped if --quiet is specified. Move the code up to finish_object(). Also pass the quiet flag along and make it always call show_* functions to avoid similar problems in future. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28rev-list: remove BISECT_SHOW_TRIED flagLibravatar Nguyễn Thái Ngọc Duy1-11/+1
Since c99f069 (bisect--helper: remove "--next-vars" option as it is now useless - 2009-04-21), this flag has always been off. Remove the flag and all related code. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27symbolic-ref --short: abbreviate the output unambiguouslyLibravatar Jan Krüger1-3/+8
It can be helpful to resolve a symbolic ref and output the result in a shortened form, such as for use in shell prompts. Add a "--short" option to do so. Signed-off-by: Jan Krüger <jk@jk.gs> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27branch: don't assume the merge filter ref existsLibravatar Carlos Martín Nieto1-0/+4
print_ref_list looks up the merge_filter_ref and assumes that a valid pointer is returned. When the object doesn't exist, it tries to dereference a NULL pointer. This can be the case when git branch --merged is given an argument that isn't a valid commit name. Check whether the lookup returns a NULL pointer and die with an error if it does. Add a test, while we're at it. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26Merge branch 'fc/push-prune'Libravatar Junio C Hamano1-0/+2
* fc/push-prune: push: add '--prune' option remote: refactor code into alloc_delete_ref() remote: reorganize check_pattern_match() remote: use a local variable in match_push_refs() Conflicts: builtin/push.c
2012-02-26pack-objects: Fix compilation with NO_PTHREDSLibravatar Michał Kiedrowicz1-1/+1
It looks like commit 99fb6e04 (pack-objects: convert to use parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but hasn't noticed that the 'arg' variable no longer is available. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-23Merge branch 'jk/config-include'Libravatar Junio C Hamano1-33/+63
* jk/config-include: : An assignment to the include.path pseudo-variable causes the named file : to be included in-place when Git looks up configuration variables. config: add include directive config: eliminate config_exclusive_filename config: stop using config_exclusive_filename config: provide a version of git_config with more options config: teach git_config_rename_section a file argument config: teach git_config_set_multivar_in_file a default path config: copy the return value of prefix_filename t1300: add missing &&-chaining docs/api-config: minor clarifications docs: add a basic description of the config API
2012-02-23Merge branch 'pj/remote-set-branches-usage-fix'Libravatar Junio C Hamano1-1/+1
* pj/remote-set-branches-usage-fix: remote: fix set-branches usage and documentation Conflicts: builtin/remote.c
2012-02-23merge: do not trust fstat(2) too much when checking interactivenessLibravatar Junio C Hamano1-1/+1
The heuristic used by "git merge" to decide if it automatically gives an editor upon clean automerge is to see if the standard input and the standard output is the same device and is a tty, we are in an interactive session. "The same device" test was done by comparing fstat(2) result on the two file descriptors (and they must match), and we asked isatty() only for the standard input (we insist that they are the same device and there is no point asking tty-ness of the standard output). The stat(2) emulation in the Windows port however does not give a usable value in the st_ino field, so even if the standard output is connected to something different from the standard input, "The same device" test may incorrectly return true. To accomodate it, add another isatty() check for the standard output stream as well. Reported-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22push: add '--prune' optionLibravatar Felipe Contreras1-0/+2
When pushing groups of refs to a remote, there is no simple way to remove old refs that still exist at the remote that is no longer updated from us. This will allow us to remove such refs from the remote. With this change, running this command $ git push --prune remote refs/heads/*:refs/remotes/laptop/* removes refs/remotes/laptop/foo from the remote if we do not have branch "foo" locally anymore. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-20Merge branch 'tg/tag-points-at'Libravatar Junio C Hamano1-1/+49
* tg/tag-points-at: builtin/tag.c: Fix a sparse warning tag: add --points-at list option
2012-02-20Merge branch 'zj/decimal-width'Libravatar Junio C Hamano1-15/+3
* zj/decimal-width: make lineno_width() from blame reusable for others Conflicts: cache.h pager.c
2012-02-20Merge branch 'cb/transfer-no-progress'Libravatar Junio C Hamano5-16/+18
* cb/transfer-no-progress: push/fetch/clone --no-progress suppresses progress output
2012-02-20Merge branch 'cb/receive-pack-keep-errors'Libravatar Junio C Hamano1-7/+17
* cb/receive-pack-keep-errors: do not override receive-pack errors
2012-02-20Merge branch 'cb/maint-rev-list-verify-object'Libravatar Junio C Hamano1-2/+2
* cb/maint-rev-list-verify-object: git rev-list: fix invalid typecast
2012-02-19remote: fix set-branches usage and documentationLibravatar Philip Jägenstedt1-1/+1
The canonical order of command line arguments is always to have dashed commands before other parameters, but the "git remote set-branches" subcommand was described to take "name" before an optional "--add". Signed-off-by: Philip Jägenstedt <philip@foolip.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-17config: add include directiveLibravatar Jeff King1-10/+28
It can be useful to split your ~/.gitconfig across multiple files. For example, you might have a "main" file which is used on many machines, but a small set of per-machine tweaks. Or you may want to make some of your config public (e.g., clever aliases) while keeping other data back (e.g., your name or other identifying information). Or you may want to include a number of config options in some subset of your repos without copying and pasting (e.g., you want to reference them from the .git/config of participating repos). This patch introduces an include directive for config files. It looks like: [include] path = /path/to/file This is syntactically backwards-compatible with existing git config parsers (i.e., they will see it as another config entry and ignore it unless you are looking up include.path). The implementation provides a "git_config_include" callback which wraps regular config callbacks. Callers can pass it to git_config_from_file, and it will transparently follow any include directives, passing all of the discovered options to the real callback. Include directives are turned on automatically for "regular" git config parsing. This includes calls to git_config, as well as calls to the "git config" program that do not specify a single file (e.g., using "-f", "--global", etc). They are not turned on in other cases, including: 1. Parsing of other config-like files, like .gitmodules. There isn't a real need, and I'd rather be conservative and avoid unnecessary incompatibility or confusion. 2. Reading single files via "git config". This is for two reasons: a. backwards compatibility with scripts looking at config-like files. b. inspection of a specific file probably means you care about just what's in that file, not a general lookup for "do we have this value anywhere at all". If that is not the case, the caller can always specify "--includes". 3. Writing files via "git config"; we want to treat include.* variables as literal items to be copied (or modified), and not expand them. So "git config --unset-all foo.bar" would operate _only_ on .git/config, not any of its included files (just as it also does not operate on ~/.gitconfig). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-17config: stop using config_exclusive_filenameLibravatar Jeff King1-24/+35
The git-config command sometimes operates on the default set of config files (either reading from all, or writing to repo config), and sometimes operates on a specific file. In the latter case, we set the magic global config_exclusive_filename, and the code in config.c does the right thing. Instead, let's have git-config use the "advanced" variants of config.c's functions which let it specify an individual filename (or NULL for the default). This makes the code a lot more obvious, and fixes two small bugs: 1. A relative path specified by GIT_CONFIG=foo will look in the wrong directory if we have to chdir as part of repository setup. We already handle this properly for "git config -f foo", but the GIT_CONFIG lookup used config_exclusive_filename directly. By dropping to a single magic variable, the GIT_CONFIG case now just works. 2. Calling "git config -f foo --edit" would not respect core.editor. This is because just before editing, we called git_config, which would respect the config_exclusive_filename setting, even though this particular git_config call was not about looking in the user's specified file, but rather about loading actual git config, just as any other git program would. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-17config: copy the return value of prefix_filenameLibravatar Jeff King1-3/+4
The prefix_filename function returns a pointer to a static buffer which may be overwritten by subsequent calls. Since we are going to keep the result around for a while, let's be sure to duplicate it for safety. I don't think this can be triggered as a bug in the current code, but it's a good idea to be defensive, as any resulting bug would be quite subtle. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-14make lineno_width() from blame reusable for othersLibravatar Zbigniew Jędrzejewski-Szmek1-15/+3
builtin/blame.c has a helper function to compute how many columns we need to show a line-number, whose implementation is reusable as a more generic helper function to count the number of columns necessary to show any cardinal number. Rename it to decimal_width(), move it to pager.c and export it for use by future callers. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-14Merge branch 'jk/git-dir-lookup'Libravatar Junio C Hamano1-2/+2
* jk/git-dir-lookup: standardize and improve lookup rules for external local repos
2012-02-14Merge branch 'jk/grep-binary-attribute'Libravatar Junio C Hamano1-144/+33
* jk/grep-binary-attribute: grep: pre-load userdiff drivers when threaded grep: load file data after checking binary-ness grep: respect diff attributes for binary-ness grep: cache userdiff_driver in grep_source grep: drop grep_buffer's "name" parameter convert git-grep to use grep_source interface grep: refactor the concept of "grep source" into an object grep: move sha1-reading mutex into low-level code grep: make locking flag global
2012-02-14Merge branch 'nd/pack-objects-parseopt'Libravatar Junio C Hamano1-190/+140
* nd/pack-objects-parseopt: pack-objects: convert to use parse_options() pack-objects: remove bogus comment pack-objects: do not accept "--index-version=version,"
2012-02-14Merge branch 'mh/war-on-extra-refs'Libravatar Junio C Hamano2-42/+32
* mh/war-on-extra-refs: refs: remove the extra_refs API clone: do not add alternate references to extra_refs everything_local(): mark alternate refs as complete fetch-pack.c: inline insert_alternate_refs() fetch-pack.c: rename some parameters from "path" to "refname" clone.c: move more code into the "if (refs)" conditional t5700: document a failure of alternates to affect fetch
2012-02-14Merge branch 'jk/userdiff-config-simplify'Libravatar Junio C Hamano3-19/+4
* jk/userdiff-config-simplify: drop odd return value semantics from userdiff_config
2012-02-13do not override receive-pack errorsLibravatar Clemens Buchacher1-7/+17
Receive runs rev-list --verify-objects in order to detect missing objects. However, such errors are ignored and overridden later. Instead, consequently ignore all update commands for which an error has already been detected. Some tests in t5504 are obsoleted by this change, because invalid objects are detected even if fsck is not enabled. Instead, they now test for different error messages depending on whether or not fsck is turned on. A better fix would be to force a corruption that will be detected by fsck but not by rev-list. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13push/fetch/clone --no-progress suppresses progress outputLibravatar Clemens Buchacher5-16/+18
By default, progress output is disabled if stderr is not a terminal. The --progress option can be used to force progress output anyways. Conversely, --no-progress does not force progress output. In particular, if stderr is a terminal, progress output is enabled. This is unintuitive. Change --no-progress to force output off. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13git rev-list: fix invalid typecastLibravatar Clemens Buchacher1-2/+2
git rev-list passes rev_list_info, not rev_list objects. Without this fix, rev-list enables or disables the --verify-objects option depending on a read from an undefined memory location. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13Merge branch 'js/add-e-submodule-fix' into maintLibravatar Junio C Hamano1-0/+1
* js/add-e-submodule-fix: add -e: do not show difference in a submodule that is merely dirty
2012-02-13Merge branch 'jc/parse-date-raw' into maintLibravatar Junio C Hamano1-0/+6
* jc/parse-date-raw: parse_date(): '@' prefix forces git-timestamp parse_date(): allow ancient git-timestamp
2012-02-13Merge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maintLibravatar Junio C Hamano1-1/+2
* jc/merge-ff-only-stronger-than-signed-merge: merge: do not create a signed tag merge under --ff-only option
2012-02-13Merge branch 'jc/branch-desc-typoavoidance' into maintLibravatar Junio C Hamano1-0/+15
* jc/branch-desc-typoavoidance: branch --edit-description: protect against mistyped branch name tests: add write_script helper function
2012-02-13builtin/tag.c: Fix a sparse warningLibravatar Ramsay Jones1-1/+1
In particular, sparse complains as follows: SP builtin/tag.c builtin/tag.c:411:5: warning: symbol 'parse_opt_points_at' was \ not declared. Should it be static? In order to suppress the warning, since the parse_opt_points_at() function does not need to be an external symbol, we simply add the static modifier to the function definition. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12Merge branch 'jc/checkout-out-of-unborn'Libravatar Junio C Hamano1-0/+19
* jc/checkout-out-of-unborn: git checkout -b: allow switching out of an unborn branch
2012-02-12Merge branch 'nd/diffstat-gramnum'Libravatar Junio C Hamano1-1/+2
* nd/diffstat-gramnum: Use correct grammar in diffstat summary line
2012-02-12Merge branch 'nd/cache-tree-api-refactor'Libravatar Junio C Hamano1-2/+2
* nd/cache-tree-api-refactor: cache-tree: update API to take abitrary flags
2012-02-12Merge branch 'jk/maint-tag-show-fixes'Libravatar Junio C Hamano1-32/+40
* jk/maint-tag-show-fixes: tag: do not show non-tag contents with "-n" tag: die when listing missing or corrupt objects tag: fix output of "tag -n" when errors occur Conflicts: t/t7004-tag.sh
2012-02-12Merge branch 'jn/merge-no-edit-fix'Libravatar Junio C Hamano1-1/+2
* jn/merge-no-edit-fix: merge: do not launch an editor on "--no-edit $tag" Conflicts: builtin/merge.c
2012-02-12clone: do not add alternate references to extra_refsLibravatar Michael Haggerty1-12/+0
Alternate references are directly (and now, correctly) handled by fetch-pack, so there is no need to inform fetch-pack about them via the extra_refs back channel. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12everything_local(): mark alternate refs as completeLibravatar Michael Haggerty1-0/+6
Objects in an alternate object database are already available to the local repository and therefore don't need to be fetched. So mark them as complete in everything_local(). This fixes a test in t5700. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12fetch-pack.c: inline insert_alternate_refs()Libravatar Michael Haggerty1-6/+1
The logic of the (single) caller is clearer without encapsulating this one line in a function. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>