Tanay Abhra [Wed, 13 Aug 2014 08:22:02 +0000 (01:22 -0700)]
builtin/apply.c: replace `git_config()` with `git_config_get_string_const()`
Use `git_config_get_string_const()` instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Wed, 13 Aug 2014 08:22:01 +0000 (01:22 -0700)]
merge-recursive.c: replace `git_config()` with `git_config_get_int()`
Use `git_config_get_int()` instead of `git_config()` to take advantage
of the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Wed, 13 Aug 2014 12:43:04 +0000 (18:13 +0530)]
ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`
There is one slight behavior change, previously "merge.default"
silently ignored a NULL value and didn't raise any error. But,
in the same function, all other values raise an error on a NULL
value. So to conform with other call sites in Git, a NULL value
for "merge.default" raises an error.
The the new config-set API is not very useful here, because much of
the function is dedicated to processing "merge.<name>.variable",
which the new API does not handle well. If it were for variables
like, "merge.summary", "merge.tool", and "merge.verbosity", we could
use the new API.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Wed, 13 Aug 2014 12:22:56 +0000 (17:52 +0530)]
fast-import.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 17:56:42 +0000 (23:26 +0530)]
branch.c: replace `git_config()` with `git_config_get_string()
Use `git_config_get_string()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow. While we are at
it, return -1 if we find no value for the queried variable. Original code
returned 0 for all cases, which was checked by `add_branch_desc()` in
fmt-merge-msg.c resulting in addition of a spurious newline to the `out`
strbuf. Now, the newline addition is skipped as -1 is returned to the caller
if no value is found.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:25 +0000 (09:21 -0700)]
alias.c: replace `git_config()` with `git_config_get_string()`
Use `git_config_get_string()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:24 +0000 (09:21 -0700)]
imap-send.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:23 +0000 (09:21 -0700)]
pager.c: replace `git_config()` with `git_config_get_value()`
Use `git_config_get_value()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:22 +0000 (09:21 -0700)]
builtin/gc.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:21 +0000 (09:21 -0700)]
rerere.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:20 +0000 (09:21 -0700)]
fetchpack.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:19 +0000 (09:21 -0700)]
archive.c: replace `git_config()` with `git_config_get_bool()` family
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:18 +0000 (09:21 -0700)]
read-cache.c: replace `git_config()` with `git_config_get_*()` family
Use `git_config_get_*()` family instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.
Use an intermediate value, as `version` can not be used directly in
git_config_get_int() due to incompatible type.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:17 +0000 (09:21 -0700)]
http-backend.c: replace `git_config()` with `git_config_get_bool()` family
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 16:21:16 +0000 (09:21 -0700)]
daemon.c: replace `git_config()` with `git_config_get_bool()` family
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:19 +0000 (04:59 -0700)]
add tests for `git_config_get_string_const()`
Add tests for `git_config_get_string_const()`, check whether it
dies printing the line number and the file name if a NULL
value is retrieved for the given key.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:18 +0000 (04:59 -0700)]
add a test for semantic errors in config files
Semantic errors (for example, for alias.* variables NULL values are
not allowed) in configuration files cause a die printing the line
number and file name of the offending value.
Add a test documenting that such errors cause a die printing the
accurate line number and file name.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:17 +0000 (04:59 -0700)]
rewrite git_config() to use the config-set API
Of all the functions in `git_config*()` family, `git_config()` has the
most invocations in the whole code base. Each `git_config()` invocation
causes config file rereads which can be avoided using the config-set API.
Use the config-set API to rewrite `git_config()` to use the config caching
layer to avoid config file rereads on each invocation during a git process
lifetime. First invocation constructs the cache, and after that for each
successive invocation, `git_config()` feeds values from the config cache
instead of rereading the configuration files.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:16 +0000 (04:59 -0700)]
config: add `git_die_config()` to the config-set API
Add `git_die_config` that dies printing the line number and the file name
of the highest priority value for the configuration variable `key`. A custom
error message is also printed before dying, specified by the caller, which can
be skipped if `err` argument is set to NULL.
It has usage in non-callback based config value retrieval where we can
raise an error and die if there is a semantic error.
For example,
if (!git_config_get_value(key, &value)){
if (!strcmp(value, "foo"))
git_config_die(key, "value: `%s` is illegal", value);
else
/* do work */
}
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:15 +0000 (04:59 -0700)]
change `git_config()` return value to void
Currently `git_config()` returns an integer signifying an error code.
During rewrites of the function most of the code was shifted to
`git_config_with_options()`. `git_config_with_options()` normally
returns positive values if its `config_source` parameter is set as NULL,
as most errors are fatal, and non-fatal potential errors are guarded
by "if" statements that are entered only when no error is possible.
Still a negative value can be returned in case of race condition between
`access_or_die()` & `git_config_from_file()`. Also, all callers of
`git_config()` ignore the return value except for one case in branch.c.
Change `git_config()` return value to void and make it die if it receives
a negative value from `git_config_with_options()`.
Original-patch-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Thu, 7 Aug 2014 11:59:14 +0000 (04:59 -0700)]
add line number and file name info to `config_set`
Store file name and line number for each key-value pair in the cache
during parsing of the configuration files.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy [Thu, 7 Aug 2014 11:59:13 +0000 (04:59 -0700)]
config.c: fix accuracy of line number in errors
If a callback returns a negative value to `git_config*()` family,
they call `die()` while printing the line number and the file name.
Currently the printed line number is off by one, thus printing the
wrong line number.
Make `linenr` point to the line we just parsed during the call
to callback to get accurate line number in error messages.
Commit-message-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy [Thu, 7 Aug 2014 11:59:12 +0000 (04:59 -0700)]
config.c: mark error and warnings strings for translation
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Mon, 28 Jul 2014 10:10:39 +0000 (03:10 -0700)]
test-config: add tests for the config_set API
Expose the `config_set` C API as a set of simple commands in order to
facilitate testing. Add tests for the `config_set` API as well as for
`git_config_get_*()` family for the usual config files.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Mon, 28 Jul 2014 10:10:38 +0000 (03:10 -0700)]
add `config_set` API for caching config-like files
Currently `git_config()` uses a callback mechanism and file rereads for
config values. Due to this approach, it is not uncommon for the config
files to be parsed several times during the run of a git program, with
different callbacks picking out different variables useful to themselves.
Add a `config_set`, that can be used to construct an in-memory cache for
config-like files that the caller specifies (i.e., files like `.gitmodules`,
`~/.gitconfig` etc.). Add two external functions `git_configset_get_value`
and `git_configset_get_value_multi` for querying from the config sets.
`git_configset_get_value` follows `last one wins` semantic (i.e. if there
are multiple matches for the queried key in the files of the configset the
value returned will be the last entry in `value_list`).
`git_configset_get_value_multi` returns a list of values sorted in order of
increasing priority (i.e. last match will be at the end of the list). Add
type specific query functions like `git_configset_get_bool` and similar.
Add a default `config_set`, `the_config_set` to cache all key-value pairs
read from usual config files (repo specific .git/config, user wide
~/.gitconfig, XDG config and the global /etc/gitconfig). `the_config_set`
is populated using `git_config()`.
Add two external functions `git_config_get_value` and
`git_config_get_value_multi` for querying in a non-callback manner from
`the_config_set`. Also, add type specific query functions that are
implemented as a thin wrapper around the `config_set` API.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 23 Jul 2014 18:36:40 +0000 (11:36 -0700)]
Sync with v2.0.3
* maint:
Git 2.0.3
.mailmap: combine Stefan Beller's emails
git.1: switch homepage for stats
Junio C Hamano [Wed, 23 Jul 2014 18:35:59 +0000 (11:35 -0700)]
Merge branch 'rs/fix-unlink-unix-socket'
The unix-domain socket used by the sample credential cache daemon
tried to unlink an existing stale one at a wrong path, if the path
to the socket was given as an overlong path that does not fit in
sun_path member of the sockaddr_un structure.
* rs/fix-unlink-unix-socket:
unix-socket: remove stale socket before calling chdir()
Junio C Hamano [Wed, 23 Jul 2014 18:35:54 +0000 (11:35 -0700)]
Merge branch 'ta/string-list-init'
* ta/string-list-init:
replace memset with string-list initializers
string-list: add string_list initializer helper function
Junio C Hamano [Wed, 23 Jul 2014 18:35:49 +0000 (11:35 -0700)]
Merge branch 'mb/local-clone-after-applying-insteadof'
Apply the "if cloning from a local disk, physically copy repository
using hardlinks, unless otherwise told not to with --no-local"
optimization when url.*.insteadOf mechanism rewrites a "git clone
$URL" that refers to a repository over the network to a clone from
a local disk.
* mb/local-clone-after-applying-insteadof:
use local cloning if insteadOf makes a local URL
Junio C Hamano [Wed, 23 Jul 2014 18:35:45 +0000 (11:35 -0700)]
Merge branch 'jk/tag-sort'
* jk/tag-sort:
tag: support configuring --sort via .gitconfig
tag: fix --sort tests to use cat<<-\EOF format
Junio C Hamano [Wed, 23 Jul 2014 18:33:16 +0000 (11:33 -0700)]
Git 2.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Wed, 23 Jul 2014 12:32:10 +0000 (14:32 +0200)]
.mailmap: combine Stefan Beller's emails
Google mail has had the extension @googlemail.com for a long time
in Germany as @gmail.de was already taken by a competitor.
Nowadays the original gmail company isn't there anymore(?), hence
Googlemail also introduced @gmail.com in Germany, which I switched to.
This changed mail address of mine first appeared in
398dd4bd039680b
(2014-07-10, .mailmap: map different names with the same email
address together) ironically.
Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Wed, 23 Jul 2014 12:32:09 +0000 (14:32 +0200)]
git.1: switch homepage for stats
According to http://meta.ohloh.net/2014/07/black-duck-open-hub/
the site name of ohloh changed to openhub.
Change the man page accordingly.
Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 22 Jul 2014 18:00:23 +0000 (11:00 -0700)]
Sync with maint
* maint:
Documentation: fix missing text for rev-parse --verify
Junio C Hamano [Tue, 22 Jul 2014 17:59:36 +0000 (10:59 -0700)]
Merge branch 'rs/code-cleaning'
* rs/code-cleaning:
remote-testsvn: use internal argv_array of struct child_process in cmd_import()
bundle: use internal argv_array of struct child_process in create_bundle()
fast-import: use hashcmp() for SHA1 hash comparison
transport: simplify fetch_objs_via_rsync() using argv_array
run-command: use internal argv_array of struct child_process in run_hook_ve()
use commit_list_count() to count the members of commit_lists
strbuf: use strbuf_addstr() for adding C strings
Junio C Hamano [Tue, 22 Jul 2014 17:59:31 +0000 (10:59 -0700)]
Merge branch 'nd/path-max-must-go'
* nd/path-max-must-go:
prep_exclude: remove the artificial PATH_MAX limit
dir.h: move struct exclude declaration to top level
dir.c: coding style fix
Junio C Hamano [Tue, 22 Jul 2014 17:59:24 +0000 (10:59 -0700)]
Merge branch 'jk/alloc-commit-id'
Make sure all in-core commit objects are assigned a unique number
so that they can be annotated using the commit-slab API.
* jk/alloc-commit-id:
diff-tree: avoid lookup_unknown_object
object_as_type: set commit index
alloc: factor out commit index
add object_as_type helper for casting objects
parse_object_buffer: do not set object type
move setting of object->type to alloc_* functions
alloc: write out allocator definitions
alloc.c: remove the alloc_raw_commit_node() function
Junio C Hamano [Tue, 22 Jul 2014 17:59:18 +0000 (10:59 -0700)]
Merge branch 'kb/perf-trace'
* kb/perf-trace:
api-trace.txt: add trace API documentation
progress: simplify performance measurement by using getnanotime()
wt-status: simplify performance measurement by using getnanotime()
git: add performance tracing for git's main() function to debug scripts
trace: add trace_performance facility to debug performance issues
trace: add high resolution timer function to debug performance issues
trace: add 'file:line' to all trace output
trace: move code around, in preparation to file:line output
trace: add current timestamp to all trace output
trace: disable additional trace output for unit tests
trace: add infrastructure to augment trace output with additional info
sha1_file: change GIT_TRACE_PACK_ACCESS logging to use trace API
Documentation/git.txt: improve documentation of 'GIT_TRACE*' variables
trace: improve trace performance
trace: remove redundant printf format attribute
trace: consistently name the format parameter
trace: move trace declarations from cache.h to new trace.h
Junio C Hamano [Tue, 22 Jul 2014 17:29:07 +0000 (10:29 -0700)]
Merge branch 'ah/fix-http-push' into maint
* ah/fix-http-push:
http-push.c: make CURLOPT_IOCTLDATA a usable pointer
Junio C Hamano [Tue, 22 Jul 2014 17:28:59 +0000 (10:28 -0700)]
Merge branch 'po/error-message-style' into maint
* po/error-message-style:
doc: give some guidelines for error messages
Junio C Hamano [Tue, 22 Jul 2014 17:28:51 +0000 (10:28 -0700)]
Merge branch 'zk/log-graph-showsig' into maint
* zk/log-graph-showsig:
log: fix indentation for --graph --show-signature
Junio C Hamano [Tue, 22 Jul 2014 17:28:43 +0000 (10:28 -0700)]
Merge branch 'mg/fix-log-mergetag-color' into maint
* mg/fix-log-mergetag-color:
log: correctly identify mergetag signature verification status
Junio C Hamano [Tue, 22 Jul 2014 17:28:30 +0000 (10:28 -0700)]
Merge branch 'cb/filter-branch-prune-empty-degenerate-merges' into maint
* cb/filter-branch-prune-empty-degenerate-merges:
filter-branch: eliminate duplicate mapped parents
Junio C Hamano [Tue, 22 Jul 2014 17:28:02 +0000 (10:28 -0700)]
Merge branch 'ye/doc-http-proto' into maint
* ye/doc-http-proto:
http-protocol.txt: Basic Auth is defined in RFC 2617, not RFC 2616
Junio C Hamano [Tue, 22 Jul 2014 17:26:52 +0000 (10:26 -0700)]
Merge branch 'jm/api-strbuf-doc' into maint
* jm/api-strbuf-doc:
api-strbuf.txt minor typos
Junio C Hamano [Tue, 22 Jul 2014 17:26:45 +0000 (10:26 -0700)]
Merge branch 'jm/dedup-test-config' into maint
* jm/dedup-test-config:
t/t7810-grep.sh: remove duplicate test_config()
Junio C Hamano [Tue, 22 Jul 2014 17:26:34 +0000 (10:26 -0700)]
Merge branch 'sk/test-cmp-bin' into maint
* sk/test-cmp-bin:
t5000, t5003: do not use test_cmp to compare binary files
Junio C Hamano [Tue, 22 Jul 2014 17:26:17 +0000 (10:26 -0700)]
Merge branch 'jm/doc-wording-tweaks' into maint
* jm/doc-wording-tweaks:
Documentation: wording fixes in the user manual and glossary
Junio C Hamano [Tue, 22 Jul 2014 17:25:24 +0000 (10:25 -0700)]
Merge branch 'jm/instaweb-apache-24' into maint
* jm/instaweb-apache-24:
git-instaweb: add support for Apache 2.4
Junio C Hamano [Tue, 22 Jul 2014 17:25:17 +0000 (10:25 -0700)]
Merge branch 'bg/xcalloc-nmemb-then-size' into maint
* bg/xcalloc-nmemb-then-size:
transport-helper.c: rearrange xcalloc arguments
remote.c: rearrange xcalloc arguments
reflog-walk.c: rearrange xcalloc arguments
pack-revindex.c: rearrange xcalloc arguments
notes.c: rearrange xcalloc arguments
imap-send.c: rearrange xcalloc arguments
http-push.c: rearrange xcalloc arguments
diff.c: rearrange xcalloc arguments
config.c: rearrange xcalloc arguments
commit.c: rearrange xcalloc arguments
builtin/remote.c: rearrange xcalloc arguments
builtin/ls-remote.c: rearrange xcalloc arguments
Junio C Hamano [Tue, 22 Jul 2014 17:25:02 +0000 (10:25 -0700)]
Merge branch 'cb/byte-order' into maint
* cb/byte-order:
compat/bswap.h: fix endianness detection
compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
compat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER
Junio C Hamano [Tue, 22 Jul 2014 17:23:41 +0000 (10:23 -0700)]
Merge branch 'lt/request-pull' into maint
* lt/request-pull:
fix brown paper bag breakage in t5150-request-pull.sh
Junio C Hamano [Tue, 22 Jul 2014 17:22:57 +0000 (10:22 -0700)]
Merge branch 'ep/shell-assign-and-export-vars' into maint
* ep/shell-assign-and-export-vars:
scripts: more "export VAR=VALUE" fixes
scripts: "export VAR=VALUE" construct is not portable
Junio C Hamano [Tue, 22 Jul 2014 17:17:34 +0000 (10:17 -0700)]
Merge branch 'maint-1.9' into maint
* maint-1.9:
Documentation: fix missing text for rev-parse --verify
Junio C Hamano [Tue, 22 Jul 2014 17:16:50 +0000 (10:16 -0700)]
Merge branch 'maint-1.8.5' into maint-1.9
* maint-1.8.5:
Documentation: fix missing text for rev-parse --verify
brian m. carlson [Mon, 21 Jul 2014 23:00:35 +0000 (23:00 +0000)]
Documentation: fix missing text for rev-parse --verify
The caret (^) is used as a markup symbol in AsciiDoc. Due to the
inability of AsciiDoc to parse a line containing an unmatched caret, it
omitted the line from the output, resulting in the man page missing the
end of a sentence. Escape this caret so that the man page ends up with
the complete text.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 21 Jul 2014 19:35:39 +0000 (12:35 -0700)]
Merge branch 'maint'
* maint:
use xmemdupz() to allocate copies of strings given by start and length
use xcalloc() to allocate zero-initialized memory
Junio C Hamano [Mon, 21 Jul 2014 19:13:03 +0000 (12:13 -0700)]
Ninth batch for 2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 21 Jul 2014 18:18:57 +0000 (11:18 -0700)]
Merge branch 'rs/unify-is-branch'
* rs/unify-is-branch:
refs.c: add a public is_branch function
Junio C Hamano [Mon, 21 Jul 2014 18:18:54 +0000 (11:18 -0700)]
Merge branch 'kb/avoid-fchmod-for-now'
Replaces the only two uses of fchmod() with chmod() because the
former does not work on Windows port and because luckily we can.
* kb/avoid-fchmod-for-now:
config: use chmod() instead of fchmod()
Junio C Hamano [Mon, 21 Jul 2014 18:18:50 +0000 (11:18 -0700)]
Merge branch 'sk/mingw-uni-fix'
* sk/mingw-uni-fix:
Win32: Unicode file name support (dirent)
Win32: Unicode file name support (except dirent)
Junio C Hamano [Mon, 21 Jul 2014 18:18:46 +0000 (11:18 -0700)]
Merge branch 'ek/alt-odb-entry-fix'
* ek/alt-odb-entry-fix:
sha1_file: do not add own object directory as alternate
Junio C Hamano [Mon, 21 Jul 2014 18:18:44 +0000 (11:18 -0700)]
Merge branch 'kb/hashmap-updates'
* kb/hashmap-updates:
hashmap: add string interning API
hashmap: add simplified hashmap_get_from_hash() API
hashmap: improve struct hashmap member documentation
hashmap: factor out getting a hash code from a SHA1
Junio C Hamano [Mon, 21 Jul 2014 18:18:40 +0000 (11:18 -0700)]
Merge branch 'jk/remote-curl-squelch-extra-errors'
* jk/remote-curl-squelch-extra-errors:
remote-curl: mark helper-protocol errors more clearly
remote-curl: use error instead of fprintf(stderr)
remote-curl: do not complain on EOF from parent git
Junio C Hamano [Mon, 21 Jul 2014 18:18:37 +0000 (11:18 -0700)]
Merge branch 'rs/ref-transaction-0'
Early part of the "ref transaction" topic.
* rs/ref-transaction-0:
refs.c: change ref_transaction_update() to do error checking and return status
refs.c: remove the onerr argument to ref_transaction_commit
update-ref: use err argument to get error from ref_transaction_commit
refs.c: make update_ref_write update a strbuf on failure
refs.c: make ref_update_reject_duplicates take a strbuf argument for errors
refs.c: log_ref_write should try to return meaningful errno
refs.c: make resolve_ref_unsafe set errno to something meaningful on error
refs.c: commit_packed_refs to return a meaningful errno on failure
refs.c: make remove_empty_directories always set errno to something sane
refs.c: verify_lock should set errno to something meaningful
refs.c: make sure log_ref_setup returns a meaningful errno
refs.c: add an err argument to repack_without_refs
lockfile.c: make lock_file return a meaningful errno on failurei
lockfile.c: add a new public function unable_to_lock_message
refs.c: add a strbuf argument to ref_transaction_commit for error logging
refs.c: allow passing NULL to ref_transaction_free
refs.c: constify the sha arguments for ref_transaction_create|delete|update
refs.c: ref_transaction_commit should not free the transaction
refs.c: remove ref_transaction_rollback
Junio C Hamano [Mon, 21 Jul 2014 18:18:30 +0000 (11:18 -0700)]
Merge branch 'jl/submodule-tests'
* jl/submodule-tests:
revert: add t3513 for submodule updates
stash: add t3906 for submodule updates
am: add t4255 for submodule updates
cherry-pick: add t3512 for submodule updates
pull: add t5572 for submodule updates
rebase: add t3426 for submodule updates
merge: add t7613 for submodule updates
bisect: add t6041 for submodule updates
reset: add t7112 for submodule updates
read-tree: add t1013 for submodule updates
apply: add t4137 for submodule updates
checkout: call the new submodule update test framework
submodules: add the lib-submodule-update.sh test library
test-lib: add test_dir_is_empty()
Junio C Hamano [Mon, 21 Jul 2014 18:17:47 +0000 (11:17 -0700)]
Merge branch 'ak/profile-feedback-build'
* ak/profile-feedback-build:
Fix profile feedback with -jN and add profile-fast
Run the perf test suite for profile feedback too
Don't define away __attribute__ on gcc
Use BASIC_FLAGS for profile feedback
Junio C Hamano [Mon, 21 Jul 2014 18:17:45 +0000 (11:17 -0700)]
Merge branch 'cc/for-each-mergetag'
* cc/for-each-mergetag:
commit: add for_each_mergetag()
Charles Bailey [Sat, 19 Jul 2014 16:08:57 +0000 (17:08 +0100)]
Fix contrib/subtree Makefile to patch #! line
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sat, 19 Jul 2014 15:35:34 +0000 (17:35 +0200)]
use xmemdupz() to allocate copies of strings given by start and length
Use xmemdupz() to allocate the memory, copy the data and make sure to
NUL-terminate the result, all in one step. The resulting code is
shorter, doesn't contain the constants 1 and '\0', and avoids
duplicating function parameters.
For blame, the last copied byte (o->file.ptr[o->file.size]) is always
set to NUL by fake_working_tree_commit() or read_sha1_file(), so no
information is lost by the conversion to using xmemdupz().
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sat, 19 Jul 2014 13:56:26 +0000 (15:56 +0200)]
use xcalloc() to allocate zero-initialized memory
Use xcalloc() instead of xmalloc() followed by memset() to allocate
and zero out memory because it's shorter and avoids duplicating the
function parameters.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Fri, 18 Jul 2014 09:19:00 +0000 (02:19 -0700)]
replace memset with string-list initializers
Using memset and then manually setting values of the string-list
members is not future proof as the internal representation of
string-list may change any time.
Use `string_list_init()` or STRING_LIST_INIT_* macros instead of
memset.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra [Fri, 18 Jul 2014 09:18:59 +0000 (02:18 -0700)]
string-list: add string_list initializer helper function
The string-list API has STRING_LIST_INIT_* macros to be used
to define variables with initializers, but lacks functions
to initialize an uninitialized piece of memory to be used as
a string-list at the run-time.
Introduce `string_list_init()` function for that.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sun, 20 Jul 2014 08:00:41 +0000 (10:00 +0200)]
unix-socket: remove stale socket before calling chdir()
unix_stream_listen() is given a path. It calls unix_sockaddr_init(),
which in turn can call chdir(). After that a relative path doesn't
mean the same as before. Any use of the original path should thus
happen before that call. For that reason, unlink the given path
(to get rid of a possibly existing stale socket) right at the
beginning of the function.
Noticed-by: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Fri, 18 Jul 2014 15:20:19 +0000 (17:20 +0200)]
remote-testsvn: use internal argv_array of struct child_process in cmd_import()
Use the existing argv_array member instead of providing our own. This
way we don't have to initialize or clean it up explicitly.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Thu, 17 Jul 2014 23:27:41 +0000 (01:27 +0200)]
bundle: use internal argv_array of struct child_process in create_bundle()
Use the existing argv_array member instead of providing our own. This
way the argv_array is cleared after use automatically for us; it was
leaking before.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Fri, 18 Jul 2014 16:00:51 +0000 (18:00 +0200)]
fast-import: use hashcmp() for SHA1 hash comparison
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Fri, 18 Jul 2014 15:12:34 +0000 (17:12 +0200)]
transport: simplify fetch_objs_via_rsync() using argv_array
Use the existing argv_array member instead of building the arguments
list using a string array and a strbuf. This way we don't need magic
number constants and allocations are cleaned up for us automatically
by run_command().
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Wed, 16 Jul 2014 21:57:47 +0000 (23:57 +0200)]
run-command: use internal argv_array of struct child_process in run_hook_ve()
Use the existing argv_array member instead of providing our own. This
way we don't have to initialize or clean it up explicitly.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Wed, 16 Jul 2014 23:52:09 +0000 (01:52 +0200)]
use commit_list_count() to count the members of commit_lists
Call commit_list_count() instead of open-coding it repeatedly.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Wed, 16 Jul 2014 23:38:18 +0000 (01:38 +0200)]
strbuf: use strbuf_addstr() for adding C strings
Avoid code duplication and let strbuf_addstr() call strlen() for us.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Barabanov [Thu, 17 Jul 2014 07:09:32 +0000 (00:09 -0700)]
use local cloning if insteadOf makes a local URL
Move the is_local logic to the place where origin remote has been setup and
check if the remote url can be used to do local cloning.
This saves a lot of space (and time) in some of the mirroring scenarios that
involve insteadOf rewrites.
Signed-off-by: Michael Barabanov <michael.barabanov@windriver.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Thu, 10 Jul 2014 12:48:26 +0000 (14:48 +0200)]
.mailmap: map different names with the same email address together
Pretty much one year ago (
94b410bba864, Jul 12 2013, .mailmap: Map
email addresses to names) I cleaned up the output of `git shortlog
-sne` of git.git by writing a .mailmap file fot the git.git project.
During the year Jens, Kazuki and Trần contributed to git.git using
different names, but the same email address; unify them.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jacob Keller [Wed, 16 Jul 2014 21:48:02 +0000 (14:48 -0700)]
tag: support configuring --sort via .gitconfig
Add support for configuring default sort ordering for git tags. Command
line option will override this configured value, using the exact same
syntax.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg [Tue, 15 Jul 2014 23:02:38 +0000 (16:02 -0700)]
refs.c: add a public is_branch function
Both refs.c and fsck.c have their own private copies of the is_branch function.
Delete the is_branch function from fsck.c and make the version in refs.c
public.
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Tue, 15 Jul 2014 22:54:30 +0000 (00:54 +0200)]
config: use chmod() instead of fchmod()
There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
Use chmod() instead.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 16 Jul 2014 18:48:16 +0000 (11:48 -0700)]
Sync with 2.0.2
* maint:
Git 2.0.2
annotate: use argv_array
Junio C Hamano [Wed, 16 Jul 2014 18:47:32 +0000 (11:47 -0700)]
Eighth batch for 2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 16 Jul 2014 18:33:11 +0000 (11:33 -0700)]
Merge branch 'ah/fix-http-push'
An ancient rewrite passed a wrong pointer to a curl library
function in a rarely used code path.
* ah/fix-http-push:
http-push.c: make CURLOPT_IOCTLDATA a usable pointer
Junio C Hamano [Wed, 16 Jul 2014 18:33:09 +0000 (11:33 -0700)]
Merge branch 'rs/code-cleaning'
* rs/code-cleaning:
fsck: simplify fsck_commit_buffer() by using commit_list_count()
commit: use commit_list_append() instead of duplicating its code
merge: simplify merge_trivial() by using commit_list_append()
use strbuf_addch for adding single characters
use strbuf_addbuf for adding strbufs
Junio C Hamano [Wed, 16 Jul 2014 18:33:06 +0000 (11:33 -0700)]
Merge branch 'jk/skip-prefix'
One more to an already graduated topic.
* jk/skip-prefix:
tag: use skip_prefix instead of magic numbers
Junio C Hamano [Wed, 16 Jul 2014 18:33:03 +0000 (11:33 -0700)]
Merge branch 'po/error-message-style'
* po/error-message-style:
doc: give some guidelines for error messages
Junio C Hamano [Wed, 16 Jul 2014 18:33:01 +0000 (11:33 -0700)]
Merge branch 'jl/test-lint-scripts'
* jl/test-lint-scripts:
t/Makefile: always test all lint targets when running tests
t/Makefile: check helper scripts for non-portable shell commands too
Junio C Hamano [Wed, 16 Jul 2014 18:32:57 +0000 (11:32 -0700)]
Merge branch 'zk/log-graph-showsig'
The "--show-signature" option did not pay much attention to
"--graph".
* zk/log-graph-showsig:
log: fix indentation for --graph --show-signature
Junio C Hamano [Wed, 16 Jul 2014 18:32:36 +0000 (11:32 -0700)]
Merge branch 'mg/fix-log-mergetag-color'
* mg/fix-log-mergetag-color:
log: correctly identify mergetag signature verification status
Junio C Hamano [Wed, 16 Jul 2014 18:32:33 +0000 (11:32 -0700)]
Merge branch 'kb/path-max-must-go'
* kb/path-max-must-go:
cache.h: rename cache_def_free to cache_def_clear
Junio C Hamano [Wed, 16 Jul 2014 18:29:06 +0000 (11:29 -0700)]
Merge branch 'cb/filter-branch-prune-empty-degenerate-merges'
"filter-branch" left an empty single-parent commit that results when
all parents of a merge commit gets mapped to the same commit, even
under "--prune-empty".
* cb/filter-branch-prune-empty-degenerate-merges:
filter-branch: eliminate duplicate mapped parents
Junio C Hamano [Wed, 16 Jul 2014 18:26:04 +0000 (11:26 -0700)]
Merge branch 'mk/merge-incomplete-files'
Merging changes into a file that ends in an incomplete line made the
last line into a complete one, even when the other branch did not
change anything around the end of file.
* mk/merge-incomplete-files:
git-merge-file: do not add LF at EOF while applying unrelated change
t6023-merge-file.sh: fix and mark as broken invalid tests
Junio C Hamano [Wed, 16 Jul 2014 18:25:59 +0000 (11:25 -0700)]
Merge branch 'jk/strip-suffix'
* jk/strip-suffix:
prepare_packed_git_one: refactor duplicate-pack check
verify-pack: use strbuf_strip_suffix
strbuf: implement strbuf_strip_suffix
index-pack: use strip_suffix to avoid magic numbers
use strip_suffix instead of ends_with in simple cases
replace has_extension with ends_with
implement ends_with via strip_suffix
add strip_suffix function
sha1_file: replace PATH_MAX buffer with strbuf in prepare_packed_git_one()
Junio C Hamano [Wed, 16 Jul 2014 18:25:57 +0000 (11:25 -0700)]
Merge branch 'ep/submodule-code-cleanup'
* ep/submodule-code-cleanup:
submodule.c: use the ARRAY_SIZE macro