summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)AuthorFilesLines
2012-07-04Merge branch 'nd/clone-single-fix'Libravatar Junio C Hamano1-2/+5
"git clone --single-branch" to clone a single branch did not limit the cloning to the specified branch. * nd/clone-single-fix: clone: fix ref selection in --single-branch --branch=xxx
2012-06-28Merge branch 'hv/submodule-update-nuke-submodules'Libravatar Junio C Hamano1-6/+0
"git add" allows adding a regular file to the path where a submodule used to exist, but "git update-index" does not allow an equivalent operation to Porcelain writers.
2012-06-28Merge branch 'nd/stream-pack-objects'Libravatar Junio C Hamano1-6/+67
"pack-objects" learned to read large loose blobs using the streaming API, without the need to hold everything in core at once.
2012-06-28Merge branch 'nd/stream-index-pack'Libravatar Junio C Hamano1-23/+171
Use streaming API to read from the object store to avoid having to hold a large blob object in-core while running index-pack.
2012-06-28Merge branch 'mm/verify-filename-fix'Libravatar Junio C Hamano3-4/+4
"git diff COPYING HEAD:COPYING" gave a nonsense error message that claimed that the treeish HEAD did not have COPYING in it.
2012-06-28Merge branch 'jk/diff-no-index-pager'Libravatar Junio C Hamano1-7/+17
"git diff --no-index" did not work with pagers correctly.
2012-06-25Merge branch 'nd/i18n-misc'Libravatar Junio C Hamano1-2/+4
Restructure the way message strings are created, in preparation for marking them for i18n. * nd/i18n-misc: rerere: remove i18n legos in result message notes-merge: remove i18n legos in merge result message reflog: remove i18n legos in pruning message
2012-06-22clone: fix ref selection in --single-branch --branch=xxxLibravatar Nguyễn Thái Ngọc Duy1-2/+5
- do not fetch HEAD - do not also fetch refs following "xxx" Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-22Merge branch 'vr/help-per-platform'Libravatar Junio C Hamano1-3/+3
* vr/help-per-platform: Restore use of 'help.format' configuration property in 'git help'
2012-06-22Restore use of 'help.format' configuration property in 'git help'Libravatar Pat Thoyts1-3/+3
Commit 1cc8af0 "help: use HTML as the default help format on Windows" lost the ability to make use of the help.format config value by forcing the use of a compiled in default if no command-line argument was provided. This commit restores the use of the help.format value if one is available, overriding the compiled default. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21Merge branch 'vr/help-per-platform'Libravatar Junio C Hamano1-1/+7
We used to always default to "man" format even on platforms where "man" viewer is not widely available. * vr/help-per-platform: help: use HTML as the default help format on Windows
2012-06-21Merge branch 'jc/ls-files-i-dir'Libravatar Junio C Hamano2-7/+22
"git ls-files --exclude=t -i" did not consider anything under t/ as excluded, as it did not pay attention to exclusion of leading paths while walking the index. Other two users of excluded() are also updated. * jc/ls-files-i-dir: dir.c: make excluded() file scope static unpack-trees.c: use path_excluded() in check_ok_to_remove() builtin/add.c: use path_excluded() path_excluded(): update API to less cache-entry centric ls-files -i: micro-optimize path_excluded() ls-files -i: pay attention to exclusion of leading paths
2012-06-21Merge branch 'jk/version-string'Libravatar Junio C Hamano1-0/+1
Teaches git native protocol agents to show software version over the wire. * jk/version-string: http: get default user-agent from git_user_agent version: add git_user_agent function move git_version_string into version.c
2012-06-21Merge branch 'jk/clone-local'Libravatar Junio C Hamano1-5/+5
"git clone --local $path" started its life as an experiment to optionally use link/copy when cloning a repository on the disk, but we didn't deprecate it after we made the option a no-op to always use the optimization. The command learns "--no-local" option to turn this off, as a more explicit alternative over use of file:// URL. * jk/clone-local: clone: allow --no-local to turn off local optimizations docs/clone: mention that --local may be ignored
2012-06-18verify_filename(): ask the caller to chose the kind of diagnosisLibravatar Matthieu Moy3-4/+4
verify_filename() can be called in two different contexts. Either we just tried to interpret a string as an object name, and it fails, so we try looking for a working tree file (i.e. we finished looking at revs that come earlier on the command line, and the next argument must be a pathname), or we _know_ that we are looking for a pathname, and shouldn't even try interpreting the string as an object name. For example, with this change, we get: $ git log COPYING HEAD:inexistant fatal: HEAD:inexistant: no such path in the working tree. Use '-- <path>...' to specify paths that do not exist locally. $ git log HEAD:inexistant fatal: Path 'inexistant' does not exist in 'HEAD' Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-17Merge branch 'js/maint-fast-export-mark-error' into maintLibravatar Junio C Hamano1-1/+1
"git fast-export" did not give a readable error message when the same mark erroneously appeared twice in the --import-marks input.
2012-06-15fix pager.diff with diff --no-indexLibravatar Jeff King1-7/+17
git-diff does not rely on the git wrapper to setup its pager; instead, it sets it up on its own after seeing whether --quiet or --exit-code has been specified. After diff_no_index was split off from cmd_diff, commit b3fde6c (git diff --no-index: default to page like other diff frontends, 2008-05-26) duplicated the one-liner from cmd_diff to turn on the pager. Later, commit 8f0359f (Allow pager of diff command be enabled/disabled, 2008-07-21) taught the the version in cmd_diff to respect the pager.diff config, but the version in diff_no_index was left behind. This meant that git -c pager.diff=0 diff a b would not use a pager, but git -c pager.diff=0 diff --no-index a b would. Let's fix it by factoring out a common function. While we're there, let's update the antiquated comment, which claims that the pager interferes with propagating the exit code; this has not been the case since ea27a18 (spawn pager via run_command interface, 2008-07-22). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-12Merge branch 'jc/fmt-merge-msg-people'Libravatar Junio C Hamano1-2/+2
Tone down the lines that credit people involved and make them comments, so that integrators who edit their merge messages can still make use of the information, but lazy ones will not leave the unverified guesses placed on the "via" line. * jc/fmt-merge-msg-people: fmt-merge-msg: make attribution into comment lines
2012-06-12Merge branch 'js/maint-fast-export-mark-error'Libravatar Junio C Hamano1-1/+1
* js/maint-fast-export-mark-error: fast-export: report SHA-1 instead of gibberish when marks exist already
2012-06-11update-index: allow overwriting existing submodule index entriesLibravatar Heiko Voigt1-6/+0
In commit e01105 Linus introduced gitlinks to update-index. He explains that he thinks it is not the right thing to replace a gitlink with something else. That commit is from the very first beginnings of submodule support. Since then we have gotten a lot closer to being able to remove a submodule without losing its history. This check prevents such a use case, so I think this assumption has changed. Additionally in the git add codepath we do not have such a check, so for consistency reasons I think removing this check is the correct thing to do. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-07reflog: remove i18n legos in pruning messageLibravatar 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>
2012-06-06fmt-merge-msg: make attribution into comment linesLibravatar Junio C Hamano1-2/+2
The submaintainer credit is not something you can compute purely by looking at the history and its shape, especially in the presense of fast-forward merges, and this observation makes the information on the "via" line unreliable. Let's leave the final determination of credits up to whoever is making the merge and show them as comments. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-06help: use HTML as the default help format on WindowsLibravatar Vincent van Ravesteijn1-1/+7
When 'git help $cmd' is run without a format option (e.g. -w), the 'man' format is always used. On some platforms, however, manual page viewers are not often available. Introduce DEFAULT_HELP_FORMAT make variable in order to allow the default format configurable at compile time, and set it to HTML when compiling on Windows (but not Cygwin). Helped-by: Jeff King <peff@peff.net> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-05builtin/add.c: use path_excluded()Libravatar Junio C Hamano1-1/+5
This only happens in --ignore-missing --dry-run codepath which presumably nobody should care, but is for completeness. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-05path_excluded(): update API to less cache-entry centricLibravatar Junio C Hamano1-2/+8
It was stupid of me to make the API too much cache-entry specific; the caller may want to check arbitrary pathname without having a corresponding cache-entry to see if a path is ignored. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-03ls-files -i: pay attention to exclusion of leading pathsLibravatar Junio C Hamano1-6/+11
"git ls-files --exclude=t/ -i" does not show paths in directory t/ that have been added to the index, but it should. The excluded() API was designed for callers who walk the tree from the top, checking each level of the directory hierarchy as it descends if it is excluded, and not even bothering to recurse into an excluded directory. This would allow us optimize for a common case by not having to check if the exclude pattern "foo/" matches when looking at "foo/bar", because the caller should have noticed that "foo" is excluded and did not even bother to read "foo/bar" out of opendir()/readdir() to call it. The code for "ls-files -i" however walks the index linearly, feeding paths without checking if the leading directory is already excluded. Introduce a helper function path_excluded() to let this caller properly call excluded() check for higher hierarchies as necessary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-03move git_version_string into version.cLibravatar Jeff King1-0/+1
The global git_version_string currently lives in git.c, but doesn't have anything to do with the git wrapper. Let's move it into its own file, where it will be more appropriate to build more version-related functions. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-01Merge branch 'rs/maint-grep-F' into maintLibravatar Junio C Hamano1-5/+2
"git grep -e '$pattern'", unlike the case where the patterns are read from a file, did not treat individual lines in the given pattern argument as separate regular expressions as it should. By René Scharfe * rs/maint-grep-F: grep: stop leaking line strings with -f grep: support newline separated pattern list grep: factor out do_append_grep_pat() grep: factor out create_grep_pat()
2012-06-01Merge branch 'ap/checkout-no-progress-for-non-tty' into maintLibravatar Junio C Hamano1-2/+2
"git checkout" gave progress display even when the standard error stream was not connected to the tty, which made little sense. By Avery Pennarun * ap/checkout-no-progress-for-non-tty: checkout: no progress messages if !isatty(2).
2012-06-01i18n: apply: split to fix a partial i18n messageLibravatar Jiang Xin1-4/+12
The 4th arg of "new mode (%o) of %s does not match old mode (%o)%s%s" is blank string or string " of ". Even mark the string " of " for a complete i18n, this message is still hard to translate right. Split it into two slight different messages would make l10n teams happy. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-30clone: allow --no-local to turn off local optimizationsLibravatar Jeff King1-5/+5
This is basically the same as using "file://", but is a little less subtle for the end user. It also allows relative paths to be specified. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-29Merge branch 'jk/ident-gecos-strbuf'Libravatar Junio C Hamano6-47/+20
Fixes quite a lot of brokenness when ident information needs to be taken from the system and cleans up the code. By Jeff King * jk/ident-gecos-strbuf: (22 commits) format-patch: do not use bogus email addresses in message ids ident: reject bogus email addresses with IDENT_STRICT ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT format-patch: use GIT_COMMITTER_EMAIL in message ids ident: let callers omit name with fmt_indent ident: refactor NO_DATE flag in fmt_ident ident: reword empty ident error message format-patch: refactor get_patch_filename ident: trim whitespace from default name/email ident: use a dynamic strbuf in fmt_ident ident: use full dns names to generate email addresses ident: report passwd errors with a more friendly message drop length limitations on gecos-derived names and emails ident: don't write fallback username into git_default_name fmt_ident: drop IDENT_WARN_ON_NO_NAME code format-patch: use default email for generating message ids ident: trim trailing newline from /etc/mailname move git_default_* variables to ident.c move identity config parsing to ident.c fmt-merge-msg: don't use static buffer in record_person ...
2012-05-29Merge branch 'jk/fetch-pack-remove-dups-optim'Libravatar Junio C Hamano1-22/+30
The way "fetch-pack" that is given multiple references to fetch tried to remove duplicates was very inefficient. By Jeff King * jk/fetch-pack-remove-dups-optim: fetch-pack: sort incoming heads list earlier fetch-pack: avoid quadratic loop in filter_refs fetch-pack: sort the list of incoming refs add sorting infrastructure for list refs fetch-pack: avoid quadratic behavior in remove_duplicates fetch-pack: sort incoming heads
2012-05-29Merge branch 'mh/fetch-pack-constness'Libravatar Junio C Hamano1-74/+71
Tighten constness of some local variables in a callchain. By Michael Haggerty * mh/fetch-pack-constness: cmd_fetch_pack(): respect constness of argv parameter cmd_fetch_pack(): combine the loop termination conditions cmd_fetch_pack(): handle non-option arguments outside of the loop cmd_fetch_pack(): declare dest to be const
2012-05-29Merge branch 'ng/pack-objects-cleanup'Libravatar Junio C Hamano1-151/+173
By Nguyễn Thái Ngọc Duy * ng/pack-objects-cleanup: pack-objects: refactor write_object() into helper functions pack-objects, streaming: turn "xx >= big_file_threshold" to ".. > .."
2012-05-29pack-objects: use streaming interface for reading large loose blobsLibravatar Nguyễn Thái Ngọc Duy1-6/+67
git usually streams large blobs directly to packs. But there are cases where git can create large loose blobs (unpack-objects or hash-object over pipe). Or they can come from other git implementations. core.bigfilethreshold can also be lowered down and introduce a new wave of large loose blobs. Use streaming interface to read/compress/write these blobs in one go. Fall back to normal way if somehow streaming interface cannot be used. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-25Merge branch 'ap/checkout-no-progress-for-non-tty'Libravatar Junio C Hamano1-2/+2
The progress indicator for a large "git checkout" was sent to stderr even if it is not a terminal.
2012-05-25Merge branch 'rs/maint-grep-F'Libravatar Junio C Hamano1-5/+2
"git grep -e '$pattern'", unlike the case where the patterns are read from a file, did not treat individual lines in the given pattern argument as separate regular expressions as it should.
2012-05-25Sync with 1.7.10.3Libravatar Junio C Hamano1-3/+5
2012-05-25fmt-merge-message: add empty line between tag and signature verificationLibravatar Linus Torvalds1-3/+5
When adding the information from a tag, put an empty line between the message of the tag and the commented-out signature verification information. At least for the kernel workflow, I often end up re-formatting the message that people send me in the tag data. In that situation, putting the tag message and the tag signature verification back-to-back then means that normal editor "reflow parapgraph" command will get confused and think that the signature is a continuation of the last message paragraph. So I always end up having to first add an empty line, and then go back and reflow the last paragraph. Let's just do it in git directly. The extra vertical space also makes the verification visually stand out more from the user-supplied message, so it looks a bit more readable to me too, but that may be just an odd personal preference. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24format-patch: do not use bogus email addresses in message idsLibravatar Jeff King1-1/+1
We can ask git_committer_info to be strict about coming up with an email, which will die automatically on a poorly configured machine. This is better than letting invalid message-ids into the wild. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24Merge branch 'jk/maint-status-porcelain-z-b' into maintLibravatar Junio C Hamano1-68/+67
"git status --porcelain" ignored "--branch" option by mistake. The output for "git status --branch -z" was also incorrect and did not terminate the record for the current branch name with NUL as asked. By Jeff King * jk/maint-status-porcelain-z-b: status: respect "-b" for porcelain format status: fix null termination with "-b" status: refactor null_termination option commit: refactor option parsing
2012-05-24ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICTLibravatar Jeff King5-8/+7
Callers who ask for ERROR_ON_NO_NAME are not so much concerned that the name will be blank (because, after all, we will fall back to using the username), but rather it is a check to make sure that low-quality identities do not end up in things like commit messages or emails (whereas it is OK for them to end up in things like reflogs). When future commits add more quality checks on the identity, each of these callers would want to use those checks, too. Rather than modify each of them later to add a new flag, let's refactor the flag. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24format-patch: use GIT_COMMITTER_EMAIL in message idsLibravatar Jeff King1-1/+2
Before commit 43ae9f4, we generated the tail of a message id by calling git_committer_info and parsing the email out of the result. 43ae9f4 changed to use ident_default_email directly, so we didn't have to bother with parsing. As a side effect, it meant we no longer used GIT_COMMITTER_EMAIL at all. In general, this is probably reasonable behavior. Either the default email is sane on your system, or you are using user.email to provide something sane. The exception is if you rely on GIT_COMMITTER_EMAIL being set all the time to override the bogus generated email. This is unlikely to match anybody's real-life setup, but we do use it in the test environment. And furthermore, it's what we have always done, and the change in 43ae9f4 was about cleaning up, not fixing any bug; we should be conservative and keep the behavior identical. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24checkout: no progress messages if !isatty(2).Libravatar Avery Pennarun1-2/+2
If stderr isn't a tty, we shouldn't be printing incremental progress messages. In particular, this affects 'git checkout -f . >&logfile' unless you provided -q. And git-new-workdir has no way to provide -q. It would probably be better to have progress.c check isatty(2) all the time, but that wouldn't allow things like 'git push --progress' to force progress reporting to on, so I won't try to solve the general case right now. Actual fix suggested by Jeff King. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24index-pack: use streaming interface for collision test on large blobsLibravatar Nguyễn Thái Ngọc Duy1-5/+77
When putting whole objects in core is unavoidable, try match object type and size first before actually inflating. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-24fetch-pack: sort incoming heads list earlierLibravatar Jeff King1-1/+1
Commit 4435968 started sorting heads fed to fetch-pack so that later commits could use more optimized algorithms; commit 7db8d53 switched the remove_duplicates function to such an algorithm. Of course, the sorting is more effective if you do it _before_ the algorithm in question. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-23index-pack: factor out unpack core from get_data_from_packLibravatar Nguyễn Thái Ngọc Duy1-3/+24
This allows caller to consume large inflated object with a fixed amount of memory. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-23index-pack: use streaming interface on large blobs (most of the time)Libravatar Nguyễn Thái Ngọc Duy1-8/+44
unpack_raw_entry() will not allocate and return decompressed blobs if they are larger than core.bigFileThreshold. sha1_object() may not be called on those objects because there's no actual content. sha1_object() is called later on those objects, where we can safely use get_data_from_pack() to retrieve blob content for checking. However we always do that when we definitely need the blob content. And we often don't. There are two cases when we may need object content. The first case is when we find an in-repo blob with the same SHA-1. We need to do collision test, byte-on-byte. If this test is on, the blob must be loaded on memory (i.e. no streaming). Normally (e.g. in fetch/pull/clone) this does not happen because git avoid to send objects that client already has. The other case is when --strict is specified and the object in question is not a blob, which can't happen in reality becase we deal with large _blobs_ here. Note: --verify (or git-verify-pack) a pack from current repository will trigger collision test on every object in the pack, which effectively disables this patch. This could be easily worked around by setting GIT_DIR to an imaginary place with no packs. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-23index-pack: hash non-delta objects while reading from streamLibravatar Nguyễn Thái Ngọc Duy1-11/+30
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>