Junio C Hamano [Tue, 18 Mar 2014 20:50:33 +0000 (13:50 -0700)]
Merge branch 'jk/detect-push-typo-early'
Catch "git push $there no-such-branch" early.
* jk/detect-push-typo-early:
push: detect local refspec errors early
match_explicit_lhs: allow a "verify only" mode
match_explicit: hoist refspec lhs checks into their own function
Junio C Hamano [Tue, 18 Mar 2014 20:50:29 +0000 (13:50 -0700)]
Merge branch 'jk/repack-pack-keep-objects'
* jk/repack-pack-keep-objects:
repack: add `repack.packKeptObjects` config var
Junio C Hamano [Tue, 18 Mar 2014 20:50:24 +0000 (13:50 -0700)]
Merge branch 'sh/finish-tmp-packfile'
* sh/finish-tmp-packfile:
finish_tmp_packfile():use strbuf for pathname construction
Junio C Hamano [Tue, 18 Mar 2014 20:50:21 +0000 (13:50 -0700)]
Merge branch 'dd/use-alloc-grow'
Replace open-coded reallocation with ALLOC_GROW() macro.
* dd/use-alloc-grow:
sha1_file.c: use ALLOC_GROW() in pretend_sha1_file()
read-cache.c: use ALLOC_GROW() in add_index_entry()
builtin/mktree.c: use ALLOC_GROW() in append_to_tree()
attr.c: use ALLOC_GROW() in handle_attr_line()
dir.c: use ALLOC_GROW() in create_simplify()
reflog-walk.c: use ALLOC_GROW()
replace_object.c: use ALLOC_GROW() in register_replace_object()
patch-ids.c: use ALLOC_GROW() in add_commit()
diffcore-rename.c: use ALLOC_GROW()
diff.c: use ALLOC_GROW()
commit.c: use ALLOC_GROW() in register_commit_graft()
cache-tree.c: use ALLOC_GROW() in find_subtree()
bundle.c: use ALLOC_GROW() in add_to_ref_list()
builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()
Junio C Hamano [Tue, 18 Mar 2014 20:50:11 +0000 (13:50 -0700)]
Merge branch 'dd/find-graft-with-sha1-pos'
Replace a hand-rolled binary search with a call to our generic
binary search helper function.
* dd/find-graft-with-sha1-pos:
commit.c: use the generic "sha1_pos" function for lookup
Junio C Hamano [Tue, 18 Mar 2014 20:49:32 +0000 (13:49 -0700)]
Merge branch 'fc/transport-helper-fixes'
Updates transport-helper, fast-import and fast-export to allow the
ref mapping and ref deletion in a way similar to the natively
supported transports.
* fc/transport-helper-fixes:
remote-bzr: support the new 'force' option
test-hg.sh: tests are now expected to pass
transport-helper.c: do not overwrite forced bit
transport-helper: check for 'forced update' message
transport-helper: add 'force' to 'export' helpers
transport-helper: don't update refs in dry-run
transport-helper: mismerge fix
Junio C Hamano [Tue, 18 Mar 2014 20:49:22 +0000 (13:49 -0700)]
Merge branch 'nd/sha1-file-delta-stack-leakage-fix'
Fix a small leak in the delta stack used when resolving a long
delta chain at runtime.
* nd/sha1-file-delta-stack-leakage-fix:
sha1_file: fix delta_stack memory leak in unpack_entry
Junio C Hamano [Tue, 18 Mar 2014 20:48:50 +0000 (13:48 -0700)]
Merge branch 'jk/diff-filespec-cleanup'
Portability fix to a topic already in v1.9
* jk/diff-filespec-cleanup:
diffcore.h: be explicit about the signedness of is_binary
Junio C Hamano [Tue, 18 Mar 2014 20:47:57 +0000 (13:47 -0700)]
Merge branch 'jk/clean-d-pathspec'
"git clean -d pathspec" did not use the given pathspec correctly
and ended up cleaning too much.
* jk/clean-d-pathspec:
clean: simplify dir/not-dir logic
clean: respect pathspecs with "-d"
Junio C Hamano [Thu, 13 Mar 2014 21:01:17 +0000 (14:01 -0700)]
Update draft release notes to Git 2.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 14 Mar 2014 21:27:23 +0000 (14:27 -0700)]
Merge branch 'ta/parse-commit-with-skip-prefix'
* ta/parse-commit-with-skip-prefix:
commit.c: use skip_prefix() instead of starts_with()
Junio C Hamano [Fri, 14 Mar 2014 21:27:21 +0000 (14:27 -0700)]
Merge branch 'sr/add--interactive-term-readkey'
* sr/add--interactive-term-readkey:
git-add--interactive: warn if module for interactive.singlekey is missing
git-config: document interactive.singlekey requires Term::ReadKey
Junio C Hamano [Fri, 14 Mar 2014 21:27:16 +0000 (14:27 -0700)]
Merge branch 'sh/write-pack-file-warning-message-fix'
A warning from "git pack-objects" were generated by referring to an
incorrect variable when forming the filename that we had trouble
with.
* sh/write-pack-file-warning-message-fix:
write_pack_file: use correct variable in diagnostic
Junio C Hamano [Fri, 14 Mar 2014 21:27:13 +0000 (14:27 -0700)]
Merge branch 'nd/strbuf-inline-styles'
* nd/strbuf-inline-styles:
strbuf: style fix -- top opening bracket on a separate line
Junio C Hamano [Fri, 14 Mar 2014 21:27:11 +0000 (14:27 -0700)]
Merge branch 'jn/bisect-coding-style'
* jn/bisect-coding-style:
git-bisect.sh: fix a few style issues
Junio C Hamano [Fri, 14 Mar 2014 21:27:06 +0000 (14:27 -0700)]
Merge branch 'mh/replace-refs-variable-rename'
* mh/replace-refs-variable-rename:
Document some functions defined in object.c
Add docstrings for lookup_replace_object() and do_lookup_replace_object()
rename read_replace_refs to check_replace_refs
Junio C Hamano [Fri, 14 Mar 2014 21:27:02 +0000 (14:27 -0700)]
Merge branch 'sg/archive-restrict-remote'
Allow loosening remote "git archive" invocation security check that
refuses to serve tree-ish not at the tip of any ref.
* sg/archive-restrict-remote:
add uploadarchive.allowUnreachable option
docs: clarify remote restrictions for git-upload-archive
Junio C Hamano [Fri, 14 Mar 2014 21:27:00 +0000 (14:27 -0700)]
Merge branch 'rt/help-pretty-prints-cmd-names'
* rt/help-pretty-prints-cmd-names:
help.c: rename function "pretty_print_string_list"
Junio C Hamano [Fri, 14 Mar 2014 21:26:58 +0000 (14:26 -0700)]
Merge branch 'jl/doc-submodule-update-checkout'
Add missing documentation for "submodule update --checkout".
* jl/doc-submodule-update-checkout:
submodule update: consistently document the '--checkout' option
Junio C Hamano [Fri, 14 Mar 2014 21:26:55 +0000 (14:26 -0700)]
Merge branch 'jk/doc-coding-guideline'
Elaborate on a style niggle that has been part of "mimic existing
code".
* jk/doc-coding-guideline:
CodingGuidelines: mention C whitespace rules
Junio C Hamano [Fri, 14 Mar 2014 21:26:52 +0000 (14:26 -0700)]
Merge branch 'da/difftool-git-files'
"git difftool" misbehaved when the repository is bound to the
working tree with the ".git file" mechanism, where a textual
file ".git" tells us where it is.
* da/difftool-git-files:
t7800: add a difftool test for .git-files
difftool: support repositories with .git-files
Junio C Hamano [Fri, 14 Mar 2014 21:26:50 +0000 (14:26 -0700)]
Merge branch 'tg/index-v4-format'
* tg/index-v4-format:
read-cache: add index.version config variable
test-lib: allow setting the index format version
introduce GIT_INDEX_VERSION environment variable
Junio C Hamano [Fri, 14 Mar 2014 21:26:31 +0000 (14:26 -0700)]
Merge branch 'nd/i18n-progress'
Mark the progress indicators from various time-consuming commands
for i18n/l10n.
* nd/i18n-progress:
i18n: mark all progress lines for translation
Junio C Hamano [Fri, 14 Mar 2014 21:26:29 +0000 (14:26 -0700)]
Merge branch 'mh/object-code-cleanup'
* mh/object-code-cleanup:
sha1_file.c: document a bunch of functions defined in the file
sha1_file_name(): declare to return a const string
find_pack_entry(): document last_found_pack
replace_object: use struct members instead of an array
Junio C Hamano [Fri, 14 Mar 2014 21:26:27 +0000 (14:26 -0700)]
Merge branch 'jn/am-doc-hooks'
* jn/am-doc-hooks:
am doc: add a pointer to relevant hooks
Junio C Hamano [Fri, 14 Mar 2014 21:26:22 +0000 (14:26 -0700)]
Merge branch 'jm/stash-doc-k-for-keep'
* jm/stash-doc-k-for-keep:
stash doc: mention short form -k in save description
Junio C Hamano [Fri, 14 Mar 2014 21:26:04 +0000 (14:26 -0700)]
Merge branch 'jk/remote-pushremote-config-reading'
"git push" did not pay attention to branch.*.pushremote if it is
defined earlier than remote.pushdefault; the order of these two
variables in the configuration file should not matter, but it did by
mistake.
* jk/remote-pushremote-config-reading:
remote: handle pushremote config in any order
Junio C Hamano [Fri, 14 Mar 2014 21:25:44 +0000 (14:25 -0700)]
Merge branch 'jk/commit-dates-parsing-fix'
Tighten codepaths that parse timestamps in commit objects.
* jk/commit-dates-parsing-fix:
show_ident_date: fix tz range check
log: do not segfault on gmtime errors
log: handle integer overflow in timestamps
date: check date overflow against time_t
fsck: report integer overflow in author timestamps
t4212: test bogus timestamps with git-log
Junio C Hamano [Fri, 14 Mar 2014 21:25:39 +0000 (14:25 -0700)]
Merge branch 'jh/note-trees-record-blobs'
"git notes -C <blob>" should not take an object that is not a blob.
* jh/note-trees-record-blobs:
notes: disallow reusing non-blob as a note object
Junio C Hamano [Fri, 14 Mar 2014 21:25:36 +0000 (14:25 -0700)]
Merge branch 'rt/links-for-asciidoctor'
* rt/links-for-asciidoctor:
Documentation: fix documentation AsciiDoc links for external urls
Junio C Hamano [Fri, 14 Mar 2014 21:25:31 +0000 (14:25 -0700)]
Merge branch 'nd/no-more-fnmatch'
We started using wildmatch() in place of fnmatch(3); complete the
process and stop using fnmatch(3).
* nd/no-more-fnmatch:
actually remove compat fnmatch source code
stop using fnmatch (either native or compat)
Revert "test-wildmatch: add "perf" command to compare wildmatch and fnmatch"
use wildmatch() directly without fnmatch() wrapper
Junio C Hamano [Fri, 14 Mar 2014 21:25:28 +0000 (14:25 -0700)]
Merge branch 'ak/gitweb-fit-image'
Instead of allowing an <img> to be shown in whatever size, force
scaling it to fit on the page with max-height/max-width css style
attributes.
* ak/gitweb-fit-image:
gitweb: Avoid overflowing page body frame with large images
Junio C Hamano [Fri, 14 Mar 2014 21:25:20 +0000 (14:25 -0700)]
Merge branch 'tr/diff-submodule-no-reuse-worktree'
"git diff --external-diff" incorrectly fed the submodule directory
in the working tree to the external diff driver when it knew it is
the same as one of the versions being compared.
* tr/diff-submodule-no-reuse-worktree:
diff: do not reuse_worktree_file for submodules
Junio C Hamano [Fri, 14 Mar 2014 21:25:02 +0000 (14:25 -0700)]
Merge branch 'nd/reset-setup-worktree'
"git reset" needs to refresh the index when working in a working
tree (it can also be used to match the index to the HEAD in an
otherwise bare repository), but it failed to set up the working
tree properly, causing GIT_WORK_TREE to be ignored.
* nd/reset-setup-worktree:
reset: optionally setup worktree and refresh index on --mixed
Junio C Hamano [Fri, 14 Mar 2014 21:24:59 +0000 (14:24 -0700)]
Merge branch 'lb/contrib-contacts-looser-diff-parsing'
* lb/contrib-contacts-looser-diff-parsing:
git-contacts: do not fail parsing of good diffs
Junio C Hamano [Fri, 14 Mar 2014 21:24:40 +0000 (14:24 -0700)]
Merge branch 'ks/config-file-stdin'
"git config" learned to read from the standard input when "-" is
given as the value to its "--file" parameter (attempting an
operation to update the configuration in the standard input of
course is rejected).
* ks/config-file-stdin:
config: teach "git config --file -" to read from the standard input
config: change git_config_with_options() interface
builtin/config.c: rename check_blob_write() -> check_write()
config: disallow relative include paths from blobs
Junio C Hamano [Fri, 14 Mar 2014 21:24:37 +0000 (14:24 -0700)]
Merge branch 'jk/janitorial-fixes'
* jk/janitorial-fixes:
open_istream(): do not dereference NULL in the error case
builtin/mv: don't use memory after free
utf8: use correct type for values in interval table
utf8: fix iconv error detection
notes-utils: handle boolean notes.rewritemode correctly
Junio C Hamano [Fri, 14 Mar 2014 21:24:18 +0000 (14:24 -0700)]
Merge branch 'jk/http-no-curl-easy'
Uses of curl's "multi" interface and "easy" interface do not mix
well when we attempt to reuse outgoing connections. Teach the RPC
over http code, used in the smart HTTP transport, not to use the
"easy" interface.
* jk/http-no-curl-easy:
http: never use curl_easy_perform
Junio C Hamano [Fri, 14 Mar 2014 21:24:15 +0000 (14:24 -0700)]
Merge branch 'ss/completion-rec-sub-fetch-push'
* ss/completion-rec-sub-fetch-push:
completion: teach --recurse-submodules to fetch, pull and push
Junio C Hamano [Fri, 14 Mar 2014 21:23:37 +0000 (14:23 -0700)]
Merge branch 'nd/gitignore-trailing-whitespace'
Trailing whitespaces in .gitignore files, unless they are quoted for
fnmatch(3), e.g. "path\ ", are warned and ignored.
Strictly speaking, this is a backward incompatible change, but very
unlikely to bite any sane user and adjusting should be obvious and
easy.
* nd/gitignore-trailing-whitespace:
t0008: skip trailing space test on Windows
dir: ignore trailing spaces in exclude patterns
dir: warn about trailing spaces in exclude patterns
Junio C Hamano [Fri, 14 Mar 2014 21:05:59 +0000 (14:05 -0700)]
Merge branch 'jc/check-attr-honor-working-tree'
"git check-attr" when (trying to) work on a repository with a
working tree did not work well when the working tree was specified
via --work-tree (and obviously with --git-dir).
The command also works in a bare repository but it reads from the
(possibly stale, irrelevant and/or nonexistent) index, which may
need to be fixed to read from HEAD, but that is a completely
separate issue. As a related tangent to this separate issue, we
may want to also fix "check-ignore", which refuses to work in a
bare repository, to also operate in a bare one.
* jc/check-attr-honor-working-tree:
check-attr: move to the top of working tree when in non-bare repository
t0003: do not chdir the whole test process
Jeff King [Mon, 10 Mar 2014 17:24:47 +0000 (13:24 -0400)]
clean: simplify dir/not-dir logic
When we get a list of paths from read_directory, we further
prune it to create the final list of items to remove. The
code paths for directories and non-directories repeat the
same "add to list" code.
This patch restructures the code so that we don't repeat
ourselves. Also, by following a "if (condition) continue"
pattern like the pathspec check above, it makes it more
obvious that the conditional is about excluding directories
under certain circumstances.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Mon, 10 Mar 2014 20:37:30 +0000 (16:37 -0400)]
clean: respect pathspecs with "-d"
git-clean uses read_directory to fill in a `struct dir` with
potential hits. However, read_directory does not actually
check against our pathspec. It uses a simplified version
that may turn up false positives. As a result, we need to
check that any hits match our pathspec. We do so reliably
for non-directories. For directories, if "-d" is not given
we check that the pathspec matched exactly (i.e., we are
even stricter, and require an explicit "git clean foo" to
clean "foo/"). But if "-d" is given, rather than relaxing
the exact match to allow a recursive match, we do not check
the pathspec at all.
This regression was introduced in
113f10f (Make git-clean a
builtin, 2007-11-11).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt [Tue, 11 Mar 2014 07:46:40 +0000 (08:46 +0100)]
t0008: skip trailing space test on Windows
The Windows API does not preserve file names with trailing spaces (and
dots), but rather strips them. Our tools (MSYS bash, git) base the POSIX
emulation on the Windows API. As a consequence, it is impossible for bash
on Windows to allocate a file whose name has trailing spaces, and for git
to stat such a file. Both operate on a file whose name has the spaces
stripped. Skip the test that needs such a file name.
Note that we do not use (another incarnation of) prerequisite FUNNYNAMES.
The reason is that FUNNYNAMES is intended to represent a property of the
file system. But the inability to have trailing spaces in a file name is
a property of the Windows API. The file system (NTFS) does not have this
limitation.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 7 Mar 2014 23:12:19 +0000 (15:12 -0800)]
Start preparing for Git 2.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 7 Mar 2014 23:18:17 +0000 (15:18 -0800)]
Merge branch 'cc/starts-n-ends-with-endgame'
prefixcmp/suffixcmp are gone.
Junio C Hamano [Fri, 7 Mar 2014 23:17:40 +0000 (15:17 -0800)]
Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'
Remove a confusing and deprecated "-q" option from "git diff-files";
"git diff-files --diff-filter=d" can be used instead.
Junio C Hamano [Fri, 7 Mar 2014 23:17:20 +0000 (15:17 -0800)]
Merge branch 'gj/push-more-verbose-advice'
Junio C Hamano [Fri, 7 Mar 2014 23:16:22 +0000 (15:16 -0800)]
Merge branch 'jc/core-checkstat-2.0'
"core.statinfo" configuration variable, which was a never-advertised
synonym to "core.checkstat", has been removed.
Junio C Hamano [Fri, 7 Mar 2014 23:14:47 +0000 (15:14 -0800)]
Merge branch 'jc/add-2.0-ignore-removal'
"git add <pathspec>" is the same as "git add -A <pathspec>" now,
i.e. it does not ignore removals from the directory specified.
Junio C Hamano [Fri, 7 Mar 2014 23:14:01 +0000 (15:14 -0800)]
Merge branch 'jn/add-2.0-u-A-sans-pathspec'
"git add -u" and "git add -A" without any pathspec is a tree-wide
operation now, even when they are run in a subdirectory of the
working tree.
Junio C Hamano [Fri, 7 Mar 2014 23:13:15 +0000 (15:13 -0800)]
Merge branch 'jc/push-2.0-default-to-simple'
Finally update the "git push" default behaviour to "simple".
Jeff King [Fri, 7 Mar 2014 17:15:01 +0000 (12:15 -0500)]
show_ident_date: fix tz range check
Commit
1dca155fe3fa (log: handle integer overflow in
timestamps, 2014-02-24) tried to catch integer overflow
coming from strtol() on the timezone field by comparing against
LONG_MIN/LONG_MAX. However, the intermediate "tz" variable
is an "int", which means it can never be LONG_MAX on LP64
systems; we would truncate the output from strtol before the
comparison.
Clang's -Wtautological-constant-out-of-range-compare notices
this and rightly complains.
Let's instead store the result of strtol in a long, and then
compare it against INT_MIN/INT_MAX. This will catch overflow
from strtol, and also overflow when we pass the result as an
int to show_date.
Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 5 Mar 2014 23:06:59 +0000 (15:06 -0800)]
Merge branch 'maint'
* maint:
i18n: proposed command missing leading dash
Junio C Hamano [Wed, 5 Mar 2014 23:06:42 +0000 (15:06 -0800)]
Merge branch 'jk/run-network-tests-by-default'
Teach "make test" to run networking tests when possible by default.
* jk/run-network-tests-by-default:
tests: turn on network daemon tests by default
Junio C Hamano [Wed, 5 Mar 2014 23:06:38 +0000 (15:06 -0800)]
Merge branch 'nd/daemonize-gc'
Allow running "gc --auto" in the background.
* nd/daemonize-gc:
gc: config option for running --auto in background
daemon: move daemonize() to libgit.a
Junio C Hamano [Wed, 5 Mar 2014 23:06:26 +0000 (15:06 -0800)]
Merge branch 'ks/combine-diff'
Teach combine-diff to honour the path-output-order imposed by
diffcore-order, and optimize how matching paths are found in
the N-way diffs made with parents.
* ks/combine-diff:
tests: add checking that combine-diff emits only correct paths
combine-diff: simplify intersect_paths() further
combine-diff: combine_diff_path.len is not needed anymore
combine-diff: optimize combine_diff_path sets intersection
diff test: add tests for combine-diff with orderfile
diffcore-order: export generic ordering interface
Jeff King [Wed, 5 Mar 2014 19:04:54 +0000 (14:04 -0500)]
push: detect local refspec errors early
When pushing, we do not even look at our push refspecs until
after we have made contact with the remote receive-pack and
gotten its list of refs. This means that we may go to some
work, including asking the user to log in, before realizing
we have simple errors like "git push origin matser".
We cannot catch all refspec problems, since fully evaluating
the refspecs requires knowing what the remote side has. But
we can do a quick sanity check of the local side and catch a
few simple error cases.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 5 Mar 2014 19:03:43 +0000 (14:03 -0500)]
match_explicit_lhs: allow a "verify only" mode
The match_explicit_lhs function has all of the logic
necessary to verify the refspecs without actually doing any
work. This patch lets callers pass a NULL "match" pointer to
indicate they want a "verify only" operation.
For the most part, we just need to avoid writing to the NULL
pointer. However, we also have to refactor the
try_explicit_object_name sub-function; it indicates success by
allocating and returning a new ref. Instead, we give it an
"out" parameter for the match and return a numeric status.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 5 Mar 2014 19:03:21 +0000 (14:03 -0500)]
match_explicit: hoist refspec lhs checks into their own function
In preparation for being able to check the left-hand side of
our push refspecs separately, this pulls the examination of
them out into its own function. There should be no behavior
change.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 5 Mar 2014 09:23:35 +0000 (01:23 -0800)]
t7800: add a difftool test for .git-files
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sandy Carter [Mon, 3 Mar 2014 14:55:53 +0000 (09:55 -0500)]
i18n: proposed command missing leading dash
Add missing leading dash to proposed commands in french output when
using the command:
git branch --set-upstream remotename/branchname
and when upstream is gone
Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Tue, 4 Mar 2014 21:06:30 +0000 (13:06 -0800)]
commit.c: use skip_prefix() instead of starts_with()
In record_author_date() & parse_gpg_output(), the callers of
starts_with() not just want to know if the string starts with the
prefix, but also can benefit from knowing the string that follows
the prefix.
By using skip_prefix(), we can do both at the same time.
Helped-by: Max Horn <max@quendi.de>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jacopo Notarstefano [Tue, 4 Mar 2014 00:21:43 +0000 (01:21 +0100)]
git-bisect.sh: fix a few style issues
Redirection operators should have a space before them, but not after them.
Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:32:02 +0000 (02:32 +0400)]
sha1_file.c: use ALLOC_GROW() in pretend_sha1_file()
Helped-by: He Sun <sunheehnus@gmail.com>
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:32:01 +0000 (02:32 +0400)]
read-cache.c: use ALLOC_GROW() in add_index_entry()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:32:00 +0000 (02:32 +0400)]
builtin/mktree.c: use ALLOC_GROW() in append_to_tree()
Helped-by: He Sun <sunheehnus@gmail.com>
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:59 +0000 (02:31 +0400)]
attr.c: use ALLOC_GROW() in handle_attr_line()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:58 +0000 (02:31 +0400)]
dir.c: use ALLOC_GROW() in create_simplify()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:57 +0000 (02:31 +0400)]
reflog-walk.c: use ALLOC_GROW()
Use ALLOC_GROW() instead of open-coding it in add_commit_info() and
read_one_reflog().
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:56 +0000 (02:31 +0400)]
replace_object.c: use ALLOC_GROW() in register_replace_object()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:55 +0000 (02:31 +0400)]
patch-ids.c: use ALLOC_GROW() in add_commit()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:54 +0000 (02:31 +0400)]
diffcore-rename.c: use ALLOC_GROW()
Use ALLOC_GROW() instead of open-coding it in locate_rename_dst()
and register_rename_src().
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:53 +0000 (02:31 +0400)]
diff.c: use ALLOC_GROW()
Use ALLOC_GROW() instead of open-coding it in diffstat_add() and
diff_q().
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:52 +0000 (02:31 +0400)]
commit.c: use ALLOC_GROW() in register_commit_graft()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:51 +0000 (02:31 +0400)]
cache-tree.c: use ALLOC_GROW() in find_subtree()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:50 +0000 (02:31 +0400)]
bundle.c: use ALLOC_GROW() in add_to_ref_list()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko [Mon, 3 Mar 2014 22:31:49 +0000 (02:31 +0400)]
builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Simon Ruderich [Mon, 3 Mar 2014 21:16:12 +0000 (22:16 +0100)]
git-add--interactive: warn if module for interactive.singlekey is missing
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Simon Ruderich [Mon, 3 Mar 2014 21:15:50 +0000 (22:15 +0100)]
git-config: document interactive.singlekey requires Term::ReadKey
Most distributions don't require Term::ReadKey as dependency, leaving
the user to wonder why the setting doesn't work.
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sat, 1 Mar 2014 02:50:55 +0000 (09:50 +0700)]
strbuf: style fix -- top opening bracket on a separate line
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Mon, 3 Mar 2014 20:04:20 +0000 (15:04 -0500)]
repack: add `repack.packKeptObjects` config var
The git-repack command always passes `--honor-pack-keep`
to pack-objects. This has traditionally been a good thing,
as we do not want to duplicate those objects in a new pack,
and we are not going to delete the old pack.
However, when bitmaps are in use, it is important for a full
repack to include all reachable objects, even if they may be
duplicated in a .keep pack. Otherwise, we cannot generate
the bitmaps, as the on-disk format requires the set of
objects in the pack to be fully closed.
Even if the repository does not generally have .keep files,
a simultaneous push could cause a race condition in which a
.keep file exists at the moment of a repack. The repack may
try to include those objects in one of two situations:
1. The pushed .keep pack contains objects that were
already in the repository (e.g., blobs due to a revert of
an old commit).
2. Receive-pack updates the refs, making the objects
reachable, but before it removes the .keep file, the
repack runs.
In either case, we may prefer to duplicate some objects in
the new, full pack, and let the next repack (after the .keep
file is cleaned up) take care of removing them.
This patch introduces both a command-line and config option
to disable the `--honor-pack-keep` option. By default, it
is triggered when pack.writeBitmaps (or `--write-bitmap-index`
is turned on), but specifying it explicitly can override the
behavior (e.g., in cases where you prefer .keep files to
bitmaps, but only when they are present).
Note that this option just disables the pack-objects
behavior. We still leave packs with a .keep in place, as we
do not necessarily know that we have duplicated all of their
objects.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sun He [Mon, 3 Mar 2014 09:24:29 +0000 (17:24 +0800)]
finish_tmp_packfile():use strbuf for pathname construction
The old version fixes a maximum length on the buffer, which could be a problem
if one is not certain of the length of get_object_directory().
Using strbuf can avoid the protential bug.
Helped-by: Michael Haggerty <mhagger@alum.mit.edu>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Sun He <sunheehnus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 3 Mar 2014 20:13:20 +0000 (12:13 -0800)]
Merge branch 'sh/write-pack-file-warning-message-fix' into sh/finish-tmp-packfile
* sh/write-pack-file-warning-message-fix:
write_pack_file: use correct variable in diagnostic
Sun He [Sun, 2 Mar 2014 07:30:11 +0000 (15:30 +0800)]
write_pack_file: use correct variable in diagnostic
'pack_tmp_name' is the subject of the utime() check, so report it in the
warning, not the uninitialized 'tmpname'
Signed-off-by: Sun He <sunheehnus@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jens Lehmann [Fri, 28 Feb 2014 22:41:11 +0000 (22:41 +0000)]
submodule update: consistently document the '--checkout' option
Commit
322bb6e12f (add update 'none' flag to disable update of submodule
by default) added the '--checkout' option to "git submodule update" but
forgot to explicitly document it in synopsis, usage string and man page
(It is only mentioned implicitly in the man page). In
23d25e48 (submodule:
explicit local branch creation in module_clone) the synopsis of the man
page was updated, but the "OPTIONS" section of the man page and the usage
string of the git-submodule script still do not mention the '--checkout'
option.
Fix that by documenting this option in usage string and the "OPTIONS"
section of man page too. While at it group the update-mode options into
a single set in the usage string.
Reported-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ralf Thielow [Fri, 28 Feb 2014 19:27:29 +0000 (20:27 +0100)]
help.c: rename function "pretty_print_string_list"
The part "string_list" of the name of function
"pretty_print_string_list" is just an implementation
detail. The function pretty-prints command names so
rename it to "pretty_print_cmdnames".
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 28 Feb 2014 16:29:17 +0000 (17:29 +0100)]
Document some functions defined in object.c
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 28 Feb 2014 16:29:16 +0000 (17:29 +0100)]
Add docstrings for lookup_replace_object() and do_lookup_replace_object()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 28 Feb 2014 06:17:25 +0000 (01:17 -0500)]
CodingGuidelines: mention C whitespace rules
We are fairly consistent about these, so most are covered by
"follow existing style", but it doesn't hurt to be explicit.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Scott J. Goldman [Fri, 28 Feb 2014 10:04:19 +0000 (05:04 -0500)]
add uploadarchive.allowUnreachable option
In commit
ee27ca4, we started restricting remote git-archive
invocations to only accessing reachable commits. This
matches what upload-pack allows, but does restrict some
useful cases (e.g., HEAD:foo). We loosened this in
0f544ee,
which allows `foo:bar` as long as `foo` is a ref tip.
However, that still doesn't allow many useful things, like:
1. Commits accessible from a ref, like `foo^:bar`, which
are reachable
2. Arbitrary sha1s, even if they are reachable.
We can do a full object-reachability check for these cases,
but it can be quite expensive if the client has sent us the
sha1 of a tree; we have to visit every sub-tree of every
commit in the worst case.
Let's instead give site admins an escape hatch, in case they
prefer the more liberal behavior. For many sites, the full
object database is public anyway (e.g., if you allow dumb
walker access), or the site admin may simply decide the
security/convenience tradeoff is not worth it.
This patch adds a new config option to disable the
restrictions added in
ee27ca4. It defaults to off, meaning
there is no change in behavior by default.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 28 Feb 2014 10:01:29 +0000 (05:01 -0500)]
docs: clarify remote restrictions for git-upload-archive
Commits
ee27ca4 and
0f544ee introduced rules by which
git-upload-archive would restrict clients from accessing
unreachable objects. However, we never documented those
rules anywhere, nor their reason for being. Let's do so now.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 27 Feb 2014 22:01:50 +0000 (14:01 -0800)]
Merge branch 'nd/http-fetch-shallow-fix'
Attempting to deepen a shallow repository by fetching over smart
HTTP transport failed in the protocol exchange, when no-done
extension was used. The fetching side waited for the list of
shallow boundary commits after the sending end stopped talking to
it.
* nd/http-fetch-shallow-fix:
t5537: move http tests out to t5539
fetch-pack: fix deepen shallow over smart http with no-done cap
protocol-capabilities.txt: document no-done
protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt
pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done'
test: rename http fetch and push test files
Junio C Hamano [Thu, 27 Feb 2014 22:01:48 +0000 (14:01 -0800)]
Merge branch 'jk/pack-bitmap'
Borrow the bitmap index into packfiles from JGit to speed up
enumeration of objects involved in a commit range without having to
fully traverse the history.
* jk/pack-bitmap: (26 commits)
ewah: unconditionally ntohll ewah data
ewah: support platforms that require aligned reads
read-cache: use get_be32 instead of hand-rolled ntoh_l
block-sha1: factor out get_be and put_be wrappers
do not discard revindex when re-preparing packfiles
pack-bitmap: implement optional name_hash cache
t/perf: add tests for pack bitmaps
t: add basic bitmap functionality tests
count-objects: recognize .bitmap in garbage-checking
repack: consider bitmaps when performing repacks
repack: handle optional files created by pack-objects
repack: turn exts array into array-of-struct
repack: stop using magic number for ARRAY_SIZE(exts)
pack-objects: implement bitmap writing
rev-list: add bitmap mode to speed up object lists
pack-objects: use bitmaps when packing objects
pack-objects: split add_object_entry
pack-bitmap: add support for bitmap indexes
documentation: add documentation for the bitmap format
ewah: compressed bitmap implementation
...
Junio C Hamano [Thu, 27 Feb 2014 22:01:46 +0000 (14:01 -0800)]
Merge branch 'dk/blame-janitorial'
Code clean-up.
* dk/blame-janitorial:
builtin/blame.c::find_copy_in_blob: no need to scan for region end
blame.c: prepare_lines should not call xrealloc for every line
builtin/blame.c::prepare_lines: fix allocation size of sb->lineno
builtin/blame.c: eliminate same_suspect()
builtin/blame.c: struct blame_entry does not need a prev link
Junio C Hamano [Thu, 27 Feb 2014 22:01:44 +0000 (14:01 -0800)]
Merge branch 'bc/gpg-sign-everywhere'
Teach "--gpg-sign" option to many commands that create commits.
* bc/gpg-sign-everywhere:
pull: add the --gpg-sign option.
rebase: add the --gpg-sign option
rebase: parse options in stuck-long mode
rebase: don't try to match -M option
rebase: remove useless arguments check
am: add the --gpg-sign option
am: parse options in stuck-long mode
git-sh-setup.sh: add variable to use the stuck-long mode
cherry-pick, revert: add the --gpg-sign option
Junio C Hamano [Thu, 27 Feb 2014 22:01:43 +0000 (14:01 -0800)]
Merge branch 'al/docs'
A handful of documentation updates, all trivially harmless.
* al/docs:
docs/git-blame: explain more clearly the example pickaxe use
docs/git-clone: clarify use of --no-hardlinks option
docs/git-remote: capitalize first word of initial blurb
docs/merge-strategies: remove hyphen from mis-merges
Junio C Hamano [Thu, 27 Feb 2014 22:01:42 +0000 (14:01 -0800)]
Merge branch 'jk/test-ports'
Avoid having to assign port number to be used in tests manually.
* jk/test-ports:
tests: auto-set git-daemon port
tests: auto-set LIB_HTTPD_PORT from test name
Junio C Hamano [Thu, 27 Feb 2014 22:01:40 +0000 (14:01 -0800)]
Merge branch 'nd/reset-intent-to-add'
* nd/reset-intent-to-add:
reset: support "--mixed --intent-to-add" mode
Junio C Hamano [Thu, 27 Feb 2014 22:01:38 +0000 (14:01 -0800)]
Merge branch 'ks/tree-diff-walk'
* ks/tree-diff-walk:
tree-walk: finally switch over tree descriptors to contain a pre-parsed entry
revision: convert to using diff_tree_sha1()
line-log: convert to using diff_tree_sha1()
tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL
tree-diff: allow diff_tree_sha1 to accept NULL sha1