OSDN Git Service
Eric Sunshine [Thu, 2 Jan 2014 21:57:12 +0000 (16:57 -0500)]
name-hash: retire unused index_name_exists()
db5360f3f496 (name-hash: refactor polymorphic index_name_exists();
2013-09-17) split index_name_exists() into index_file_exists() and
index_dir_exists() but retained index_name_exists() as a thin wrapper
to avoid disturbing possible in-flight topics. Since this change
landed in 'master' some time ago and there are no in-flight topics
referencing index_name_exists(), retire it.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Wed, 18 Dec 2013 13:41:27 +0000 (14:41 +0100)]
hashmap.h: use 'unsigned int' for hash-codes everywhere
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder [Sat, 14 Dec 2013 02:06:40 +0000 (18:06 -0800)]
test-hashmap.c: drop unnecessary #includes
Per Documentation/CodingGuidelines most C files in git start with
a #include of git-compat-util.h or another header file that includes
it, such as cache.h or builtin.h. This file doesn't need anything
beyond "git-compat-util.h", so use that.
Remove a #include of the system header <stdio.h> since it is already
included by "git-compat-util.h".
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder [Sat, 14 Dec 2013 02:05:26 +0000 (18:05 -0800)]
.gitignore: test-hashmap is a generated file
Prevent the "test-hashmap" program from being accidentally tracked
with "git add" or cluttering "git status" output.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:24:37 +0000 (20:24 +0100)]
read-cache.c: fix memory leaks caused by removed cache entries
When cache_entry structs are removed from index_state.cache, they are not
properly freed. Freeing those entries wasn't possible before because we
couldn't remove them from index_state.name_hash.
Now that we _do_ remove the entries from name_hash, we can also free them.
Add 'free(cache_entry)' to all call sites of name-hash.c::remove_name_hash
in read-cache.c (we could free() directly in remove_name_hash(), but
name-hash.c isn't concerned with cache_entry allocation at all).
Accessing a cache_entry after removing it from the index is now no longer
allowed, as the memory has been freed. The following functions need minor
fixes (typically by copying ce->name before use):
- builtin/rm.c::cmd_rm
- builtin/update-index.c::do_reupdate
- read-cache.c::read_index_unmerged
- resolve-undo.c::unmerge_index_entry_at
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:24:08 +0000 (20:24 +0100)]
builtin/update-index.c: cleanup update_one
do_reupdate calls update_one with a cache_entry.name, there's no need for
the extra sanitation / normalization that happens in prefix_path.
cmd_update_index calls update_one with an already prefixed path, no need to
prefix_path twice.
Remove the extra prefix_path from update_one. Also remove the now unused
'prefix' and 'prefix_length' parameters.
As of
d089eba "setup: sanitize absolute and funny paths in get_pathspec()",
prefix_path uncoditionally returns a copy, even if the passed in path isn't
changed. Lets unconditionally free() the result.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:23:42 +0000 (20:23 +0100)]
fix 'git update-index --verbose --again' output
'git update-index --verbose' consistently reports paths relative to the
work-tree root. The only exception is the '--again' option, which reports
paths relative to the current working directory.
Change do_reupdate to use non-prefixed paths.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:23:12 +0000 (20:23 +0100)]
remove old hash.[ch] implementation
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:22:27 +0000 (20:22 +0100)]
name-hash.c: remove cache entries instead of marking them CE_UNHASHED
The new hashmap implementation supports remove, so really remove unused
cache entries from the name hashmap instead of just marking them.
The CE_UNHASHED flag and CE_STATE_MASK are no longer needed.
Keep the CE_HASHED flag to prevent adding entries twice.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:21:58 +0000 (20:21 +0100)]
name-hash.c: use new hash map implementation for cache entries
Note: the "ce->next = NULL;" in unpack-trees.c::do_add_entry can safely be
removed, as ce->next (now ce->ent.next) is always properly initialized in
name-hash.c::hash_index_entry.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:21:26 +0000 (20:21 +0100)]
name-hash.c: remove unreferenced directory entries
The new hashmap implementation supports remove, so remove and free
directory entries that are no longer referenced by active cache entries.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:20:58 +0000 (20:20 +0100)]
name-hash.c: use new hash map implementation for directories
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:20:26 +0000 (20:20 +0100)]
diffcore-rename.c: use new hash map implementation
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:19:34 +0000 (20:19 +0100)]
diffcore-rename.c: simplify finding exact renames
The find_exact_renames function currently only uses the hash table for
grouping, i.e.:
1. add sources
2. add destinations
3. iterate all buckets, per bucket:
4. split sources from destinations
5. iterate destinations, per destination:
6. iterate sources to find best match
This can be simplified by utilizing the lookup functionality of the hash
table, i.e.:
1. add sources
2. iterate destinations, per destination:
3. lookup sources matching the current destination
4. iterate sources to find best match
This saves several iterations and file_similarity allocations for the
destinations.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:19:04 +0000 (20:19 +0100)]
diffcore-rename.c: move code around to prepare for the next patch
No actual code changes, just move hash_filespec up and outdent part of
find_identical_files.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:18:35 +0000 (20:18 +0100)]
buitin/describe.c: use new hash map implementation
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees [Thu, 14 Nov 2013 19:17:54 +0000 (20:17 +0100)]
add a hashtable implementation that supports O(1) removal
The existing hashtable implementation (in hash.[ch]) uses open addressing
(i.e. resolve hash collisions by distributing entries across the table).
Thus, removal is difficult to implement with less than O(n) complexity.
Resolving collisions of entries with identical hashes (e.g. via chaining)
is left to the client code.
Add a hashtable implementation that supports O(1) removal and is slightly
easier to use due to builtin entry chaining.
Supports all basic operations init, free, get, add, remove and iteration.
Also includes ready-to-use hash functions based on the public domain FNV-1
algorithm (http://www.isthe.com/chongo/tech/comp/fnv).
The per-entry data structure (hashmap_entry) is piggybacked in front of
the client's data structure to save memory. See test-hashmap.c for usage
examples.
The hashtable is resized by a factor of four when 80% full. With these
settings, average memory consumption is about 2/3 of hash.[ch], and
insertion is about twice as fast due to less frequent resizing.
Lookups are also slightly faster, because entries are strictly confined to
their bucket (i.e. no data of other buckets needs to be traversed).
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jens Lehmann [Thu, 7 Nov 2013 14:33:43 +0000 (15:33 +0100)]
submodule: don't access the .gitmodules cache entry after removing it
Commit
5fee995244e introduced the stage_updated_gitmodules() function to
add submodule configuration updates to the index. It assumed that even
after calling remove_cache_entry_at() the same cache entry would still be
valid. This was true in the old days, as cache entries could never be
freed, but that is not so sure in the present as there is ongoing work to
free removed cache entries, which makes this code segfault.
Fix that by calling add_file_to_cache() instead of open coding it. Also
remove the "could not find .gitmodules in index" warning, as that won't
happen in regular use cases (and by then just silently adding it to the
index we do the right thing).
Thanks-to: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Oct 2013 22:57:12 +0000 (15:57 -0700)]
Update draft release notes to 1.8.5
Junio C Hamano [Thu, 17 Oct 2013 22:55:18 +0000 (15:55 -0700)]
Merge branch 'jk/format-patch-from'
"format-patch --from=<whom>" forgot to omit unnecessary in-body
from line, i.e. when <whom> is the same as the real author.
* jk/format-patch-from:
format-patch: print in-body "From" only when needed
Junio C Hamano [Thu, 17 Oct 2013 22:55:15 +0000 (15:55 -0700)]
Merge branch 'es/name-hash-no-trailing-slash-in-dirs'
Clean up the internal of the name-hash mechanism used to work
around case insensitivity on some filesystems to cleanly fix a
long-standing API glitch where the caller of cache_name_exists()
that ask about a directory with a counted string was required to
have '/' at one location past the end of the string.
* es/name-hash-no-trailing-slash-in-dirs:
dir: revert work-around for retired dangerous behavior
name-hash: stop storing trailing '/' on paths in index_state.dir_hash
employ new explicit "exists in index?" API
name-hash: refactor polymorphic index_name_exists()
Junio C Hamano [Thu, 17 Oct 2013 22:55:13 +0000 (15:55 -0700)]
Merge branch 'jk/trailing-slash-in-pathspec'
Code refactoring.
* jk/trailing-slash-in-pathspec:
reset: handle submodule with trailing slash
rm: re-use parse_pathspec's trailing-slash removal
Junio C Hamano [Thu, 17 Oct 2013 22:55:12 +0000 (15:55 -0700)]
Merge branch 'lc/filter-branch-too-many-refs'
"git filter-branch" in a repository with many refs blew limit of
command line length.
* lc/filter-branch-too-many-refs:
Allow git-filter-branch to process large repositories with lots of branches.
Junio C Hamano [Thu, 17 Oct 2013 22:55:08 +0000 (15:55 -0700)]
Merge branch 'jc/checkout-detach-doc'
"git checkout [--detach] <commit>" was listed poorly in the
synopsis section of its documentation.
* jc/checkout-detach-doc:
checkout: update synopsys and documentation on detaching HEAD
Junio C Hamano [Thu, 17 Oct 2013 22:54:28 +0000 (15:54 -0700)]
Sync with maint
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Oct 2013 22:50:45 +0000 (15:50 -0700)]
Start preparing for 1.8.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Oct 2013 22:46:01 +0000 (15:46 -0700)]
Merge branch 'jk/upload-pack-keepalive' into maint
* jk/upload-pack-keepalive:
upload-pack: bump keepalive default to 5 seconds
upload-pack: send keepalive packets during pack computation
Junio C Hamano [Thu, 17 Oct 2013 22:46:00 +0000 (15:46 -0700)]
Merge branch 'bc/http-backend-allow-405' into maint
* bc/http-backend-allow-405:
http-backend: provide Allow header for 405
Junio C Hamano [Thu, 17 Oct 2013 22:45:57 +0000 (15:45 -0700)]
Merge branch 'jc/cvsserver-perm-bit-fix' into maint
* jc/cvsserver-perm-bit-fix:
cvsserver: pick up the right mode bits
Junio C Hamano [Thu, 17 Oct 2013 22:45:56 +0000 (15:45 -0700)]
Merge branch 'js/add-i-mingw' into maint
* js/add-i-mingw:
add--interactive: fix external command invocation on Windows
Junio C Hamano [Thu, 17 Oct 2013 22:45:55 +0000 (15:45 -0700)]
Merge branch 'nd/git-dir-pointing-at-gitfile' into maint
* nd/git-dir-pointing-at-gitfile:
Make setup_git_env() resolve .git file when $GIT_DIR is not specified
Junio C Hamano [Thu, 17 Oct 2013 22:45:54 +0000 (15:45 -0700)]
Merge branch 'jk/has-sha1-file-retry-packed' into maint
* jk/has-sha1-file-retry-packed:
has_sha1_file: re-check pack directory before giving up
Junio C Hamano [Thu, 17 Oct 2013 22:45:51 +0000 (15:45 -0700)]
Merge branch 'ap/commit-author-mailmap' into maint
* ap/commit-author-mailmap:
commit: search author pattern against mailmap
Junio C Hamano [Thu, 17 Oct 2013 22:45:50 +0000 (15:45 -0700)]
Merge branch 'es/rebase-i-no-abbrev' into maint
* es/rebase-i-no-abbrev:
rebase -i: fix short SHA-1 collision
t3404: rebase -i: demonstrate short SHA-1 collision
t3404: make tests more self-contained
Conflicts:
t/t3404-rebase-interactive.sh
Junio C Hamano [Thu, 17 Oct 2013 22:45:45 +0000 (15:45 -0700)]
Merge branch 'rt/rebase-p-no-merge-summary' into maint
* rt/rebase-p-no-merge-summary:
rebase --preserve-merges: ignore "merge.log" config
Junio C Hamano [Thu, 17 Oct 2013 22:45:24 +0000 (15:45 -0700)]
Merge branch 'es/rebase-i-respect-core-commentchar' into maint
* es/rebase-i-respect-core-commentchar:
rebase -i: fix cases ignoring core.commentchar
SZEDER Gábor [Wed, 16 Oct 2013 12:27:16 +0000 (14:27 +0200)]
t4254: modernize tests
- Don't start tests with 'test $? = 0' to catch preparation done
outside the test_expect_success block.
- Move writing the bogus patch and the expected output into the
appropriate test_expect_success blocks.
- Use the test_must_fail helper instead of manually checking for
non-zero exit code.
- Use the debug-friendly test_path_is_file helper instead of 'test -f'.
- No space after '>'.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 16 Oct 2013 19:27:45 +0000 (12:27 -0700)]
Update draft release notes to 1.8.5
List notable topics that graduated during Jonathan's interim
maintainership.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 16 Oct 2013 17:45:58 +0000 (10:45 -0700)]
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
git-svn: Warn about changing default for --prefix in Git v2.0
Documentation/git-svn: Promote the use of --prefix in docs + examples
git-svn.txt: elaborate on rev_map files
git-svn.txt: replace .git with $GIT_DIR
git-svn.txt: reword description of gc command
git-svn.txt: fix AsciiDoc formatting error
git-svn: fix signed commit parsing
Junio C Hamano [Tue, 15 Oct 2013 23:15:00 +0000 (16:15 -0700)]
Merge branch 'maint'
* maint:
git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY
clone --branch: refuse to clone if upstream repo is empty
Steffen Prohaska [Mon, 23 Sep 2013 19:19:19 +0000 (21:19 +0200)]
git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY
git-prune-packed operates on GIT_OBJECT_DIRECTORY, not
GIT_OBJECT_DIR.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Steffen Prohaska [Mon, 23 Sep 2013 18:54:35 +0000 (20:54 +0200)]
git.txt: fix asciidoc syntax of --*-pathspecs
Labeled lists require a double colon.
[jc] I eyeballed the output from
git grep '[^:]:$' Documentation/\*.txt
and the patch fixes all breakages of this kind.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Saasen [Fri, 4 Oct 2013 14:34:53 +0000 (07:34 -0700)]
mergetool--lib: Fix typo in the merge/difftool help
The help text for the `tool` flag should mention:
--tool=<tool>
instead of:
--tool-<tool>
Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>
Reviewed-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Sun, 6 Oct 2013 20:52:21 +0000 (21:52 +0100)]
sparse: suppress some "using sizeof on a function" warnings
Sparse issues an "using sizeof on a function" warning for each
call to curl_easy_setopt() which sets an option that takes a
function pointer parameter. (currently 12 such warnings over 4
files.)
The warnings relate to the use of the "typecheck-gcc.h" header
file which adds a layer of type-checking macros to the curl
function invocations (for gcc >= 4.3 and !__cplusplus). As part
of the type-checking layer, 'sizeof' is applied to the function
parameter of curl_easy_setopt(). Note that, in the context of
sizeof, the function to function pointer conversion is not
performed and that sizeof(f) != sizeof(&f).
A simple solution, therefore, would be to replace the function
name in each such call to curl_easy_setopt() with an explicit
function pointer expression (i.e. replace f with &f).
However, the "typecheck-gcc.h" header file is only conditionally
included, in addition to the gcc and C++ checks mentioned above,
depending on the CURL_DISABLE_TYPECHECK preprocessor variable.
In order to suppress the warnings, we use target-specific variable
assignments to add -DCURL_DISABLE_TYPECHECK to SPARSE_FLAGS for
each file affected (http-push.c, http.c, http-walker.c and
remote-curl.c).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Sun, 6 Oct 2013 20:51:31 +0000 (21:51 +0100)]
format-patch doc: Thunderbird wraps lines unless mailnews.wraplength=0
The Thunderbird section of the 'MUA-specific hints' contains three
different approaches to setting up the mail client to leave patch
emails unmolested. The second approach (configuration) has a step
missing when configuring the composition window not to wrap. In
particular, the "mailnews.wraplength" configuration variable needs
to be set to zero. Update the documentation to add the missing
setting.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Mon, 14 Oct 2013 23:19:31 +0000 (16:19 -0700)]
Merge branch 'rj/highlight-test-hang'
* rj/highlight-test-hang:
gitweb test: fix highlight test hang on Linux Mint
Ramsay Jones [Sun, 6 Oct 2013 20:50:46 +0000 (21:50 +0100)]
gitweb test: fix highlight test hang on Linux Mint
Linux Mint has an implementation of the highlight command (unrelated
to the one from http://www.andre-simon.de) that works as a simple
filter. The script uses 'sed' to add terminal colour escape codes
around text matching a regular expression. When t9500-*.sh attempts
to run "highlight --version", the script simply hangs waiting for
input. (See https://bugs.launchpad.net/linuxmint/+bug/815005).
The tool required by gitweb can be installed from the 'highlight'
package. Unfortunately, given the default $PATH, this leads to the
tool having lower precedence than the script.
In order to avoid hanging the test, add '</dev/null' to the command
line of the highlight invocation. Also, since the 'highlight' tool
requred by gitweb produces '--version' output (and the script does
not), saving the command output allows a simple check for the wrong
'highlight'.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Sun, 6 Oct 2013 20:50:00 +0000 (21:50 +0100)]
wrapper.c: only define gitmkstemps if needed
When the NO_MKSTEMPS build variable is not set, the gitmkstemps
function is dead code. Use a preprocessor conditional to only include
the definition when needed.
Noticed by sparse. ("'gitmkstemps' was not declared. Should it be
static?")
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Sun, 6 Oct 2013 20:49:18 +0000 (21:49 +0100)]
refs.c: spell NULL pointer as NULL
A call to update_ref_lock() passes '0' to the 'int *type_p' parameter.
Noticed by sparse. ("Using plain integer as NULL pointer")
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Sun, 6 Oct 2013 20:48:29 +0000 (21:48 +0100)]
config.c: mark file-local function static
Commit
7192777 refactors git_parse_ulong, which is public, into a more
generic function. But since we kept the git_parse_ulong wrapper, only
that part needs to be public; nobody outside the file calls the
lower-level git_parse_unsigned.
Noticed with sparse. ("'git_parse_unsigned' was not declared. Should
it be static?")
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Explained-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
brian m. carlson [Sat, 12 Oct 2013 00:45:46 +0000 (00:45 +0000)]
CodingGuidelines: style for multi-line comments
The style for multi-line comments is often mentioned and should be documented
for clarity.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Mon, 14 Oct 2013 19:45:50 +0000 (12:45 -0700)]
Merge branch 'nv/doc-config-signingkey'
* nv/doc-config-signingkey:
config doc: user.signingkey is also used for signed commits
Nicolas Vigier [Mon, 14 Oct 2013 17:04:36 +0000 (19:04 +0200)]
config doc: user.signingkey is also used for signed commits
The description of the user.signingkey option only mentioned its use
when creating a signed tag. Make it clear that is is also used when
creating signed commits.
Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ralf Thielow [Fri, 11 Oct 2013 16:49:02 +0000 (18:49 +0200)]
clone --branch: refuse to clone if upstream repo is empty
Since
920b691 (clone: refuse to clone if --branch
points to bogus ref) we refuse to clone with option
"-b" if the specified branch does not exist in the
(non-empty) upstream. If the upstream repository is empty,
the branch doesn't exist, either. So refuse the clone too.
Reported-by: Robert Mitwicki <robert.mitwicki@opensoftware.pl>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Mon, 14 Oct 2013 18:09:30 +0000 (11:09 -0700)]
Merge branch 'sb/checkout-test-complex-path'
* sb/checkout-test-complex-path:
checkout test: enable test with complex relative path
Jonathan Nieder [Mon, 14 Oct 2013 18:08:47 +0000 (11:08 -0700)]
Merge branch 'rt/cherry-pick-status'
* rt/cherry-pick-status:
status: show commit sha1 in "You are currently cherry-picking" message
status test: add missing && to <<EOF blocks
Jonathan Nieder [Mon, 14 Oct 2013 18:07:50 +0000 (11:07 -0700)]
Merge branch 'rj/doc-formatting-fix'
* rj/doc-formatting-fix:
howto/revert-a-faulty-merge: fix unescaped '^'s
howto/setup-git-server-over-http: fix unescaped '^'s
Jonathan Nieder [Mon, 14 Oct 2013 18:07:29 +0000 (11:07 -0700)]
Merge branch 'po/remote-set-head-usage'
* po/remote-set-head-usage:
remote set-head -h: add long options to synopsis
remote doc: document long forms of set-head options
Jonathan Nieder [Mon, 14 Oct 2013 18:06:57 +0000 (11:06 -0700)]
Merge branch 'nd/clone-local-with-colon'
* nd/clone-local-with-colon:
clone: tighten "local paths with colons" check a bit
Jonathan Nieder [Mon, 14 Oct 2013 18:03:48 +0000 (11:03 -0700)]
Merge branch 'jx/clean-interactive'
* jx/clean-interactive:
path-utils test: rename mingw_path function to print_path
Jonathan Nieder [Mon, 14 Oct 2013 17:59:51 +0000 (10:59 -0700)]
Merge branch 'jk/diff-algo'
* jk/diff-algo:
merge-recursive: fix parsing of "diff-algorithm" option
Sebastian Schuberth [Thu, 10 Oct 2013 20:49:43 +0000 (22:49 +0200)]
path-utils test: rename mingw_path function to print_path
mingw_path was introduced in
abd4284 to output a mangled path as it is
passed as an argument to main(). But the name is misleading because
mangling does not come from MinGW, but from MSYS [1]. As
abd4284 does not
introduce any MSYS or MinGW specific code but just prints out argv[2] as
it is passed to main(), give the function the more generic and less
confusing name "print_path".
[1] http://www.mingw.org/wiki/Posix_path_conversion
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Fri, 11 Oct 2013 18:24:14 +0000 (19:24 +0100)]
howto/revert-a-faulty-merge: fix unescaped '^'s
Several uses of the '^' operator are being interpreted by asciidoc
as requests to show the following text as a superscript. In order
to fix this problem, use backticks (`) to quote the text of the
affected git command invocations.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Ramsay Jones [Fri, 11 Oct 2013 19:38:36 +0000 (20:38 +0100)]
howto/setup-git-server-over-http: fix unescaped '^'s
The text contains two 'grep' invocations which include the 'start
of line' regular expression character '^'. Asciidoc mis-interprets
this use of '^' as a superscript request. In order to fix this
formatting problem, use backticks (`) to quote the text of the
affected 'grep' command invocations.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Stefan Saasen [Sat, 12 Oct 2013 22:29:35 +0000 (09:29 +1100)]
mergetools/diffmerge: support DiffMerge as a git mergetool
DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux.
See http://www.sourcegear.com/diffmerge/
DiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the
graphical compare tool.
This change adds mergetool support for DiffMerge and adds 'diffmerge' as an
option to the mergetool help.
Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Thomas Rast [Sun, 13 Oct 2013 14:07:49 +0000 (16:07 +0200)]
.mailmap: switch to Thomas Rast's personal address
Normalize to my personal address, as my ETH addresses will expire
soon. Also add my new corp account to be somewhat futureproof.
Note that despite the private address being first, Google owns the
copyright as long as I am employed there.
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Johan Herland [Fri, 11 Oct 2013 12:57:06 +0000 (14:57 +0200)]
git-svn: Warn about changing default for --prefix in Git v2.0
In Git v2.0, we will change the default --prefix for init/clone from
none/empty to "origin/" (which causes SVN-tracking branches to be
placed at refs/remotes/origin/* instead of refs/remotes/*).
This patch warns users about the upcoming change, both in the git-svn
manual page, and on stderr when running init/clone in the "multi-mode"
without providing a --prefix.
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Johan Herland [Fri, 11 Oct 2013 12:57:05 +0000 (14:57 +0200)]
Documentation/git-svn: Promote the use of --prefix in docs + examples
Currently, the git-svn defaults to using an empty prefix, which ends
up placing the SVN-tracking refs directly in refs/remotes/*. This
placement runs counter to Git's convention of placing remote-tracking
branches in refs/remotes/$remote/*.
Furthermore, combining git-svn with "regular" Git remotes run the risk
of clobbering refs under refs/remotes (e.g. if you have a git remote
called "tags" with a "v1" branch, it will overlap with the git-svn's
tracking branch for the "v1" tag from Subversion.
Even though the git-svn refs stored in refs/remotes/* are not "proper"
remote-tracking branches (since they are not covered by a proper git
remote's refspec), they clearly represent a similar concept, and would
benefit from following the same convention.
For example, if git-svn tracks Subversion branch "foo" at
refs/remotes/foo, and you create a local branch refs/heads/foo to add
some commits to be pushed back to Subversion (using "git svn dcommit),
then it is clearly unhelpful of Git to throw
warning: refname 'foo' is ambiguous.
every time you checkout, rebase, or otherwise interact with the branch.
At this time, the user is better off using the --prefix=foo/ (the
trailing slash is important) to git svn init/clone, to cause the
SVN-tracking refs to be placed at refs/remotes/foo/* instead of
refs/remotes/*. This patch updates the documentation to encourage
use of --prefix.
This is also in preparation for changing the default value of --prefix
at some point in the future.
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Ralf Thielow [Fri, 11 Oct 2013 15:58:37 +0000 (17:58 +0200)]
status: show commit sha1 in "You are currently cherry-picking" message
Especially helpful when cherry-picking multiple commits.
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Fri, 11 Oct 2013 17:35:46 +0000 (10:35 -0700)]
status test: add missing && to <<EOF blocks
When a test forgets to include && after each command, it is possible
for an early command to succeed but the test to fail, which can hide
bugs.
Checked using the following patch to the test harness:
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -425,7 +425,17 @@ test_eval_ () {
eval </dev/null >&3 2>&4 "$*"
}
+check_command_chaining_ () {
+ eval >&3 2>&4 "(exit 189) && $*"
+ eval_chain_ret=$?
+ if test "$eval_chain_ret" != 189
+ then
+ error 'bug in test script: missing "&&" in test commands'
+ fi
+}
+
test_run_ () {
+ check_command_chaining_ "$1"
test_cleanup=:
expecting_failure=$2
setup_malloc_check
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Keshav Kini [Sun, 29 Sep 2013 23:46:00 +0000 (18:46 -0500)]
git-svn.txt: elaborate on rev_map files
The man page for `git svn` describes a situation in which "'git svn'
will not be able to rebuild" your $GIT_DIR/svn/**/.rev_map* files, but
no mention is made of in what circumstances `git svn` *will* be able to
do so, how to get `git svn` to do so, or even what these files are.
This patch adds a FILES section to the man page with a description of
what $GIT_DIR/svn/**/.rev_map* files are and how they are (re)built, and
links to this description from various other parts of the man page.
Signed-off-by: Keshav Kini <keshav.kini@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Keshav Kini [Sun, 29 Sep 2013 23:45:59 +0000 (18:45 -0500)]
git-svn.txt: replace .git with $GIT_DIR
As $GIT_DIR may not equal '.git', it's usually more generally correct to
refer to files in $GIT_DIR rather than in .git .
This will also allow me to link some of the occurrences of '.git' in
git-svn.txt to a new reference target inside this file in an upcoming
commit, because in AsciiDoc definitions apparently can't start with
a '.' character.
Signed-off-by: Keshav Kini <keshav.kini@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Keshav Kini [Sun, 29 Sep 2013 23:45:58 +0000 (18:45 -0500)]
git-svn.txt: reword description of gc command
It's redundant to say that $GIT_DIR/svn/<refname>/unhandled.log or
$GIT_DIR/svn/<refname>/index is in .git/svn when $GIT_DIR is '.git', and
is wrong when $GIT_DIR is not '.git'
Also, a '/' was missing from the pathname $GIT_DIR/svn/<refname>/index .
Signed-off-by: Keshav Kini <keshav.kini@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Keshav Kini [Sun, 29 Sep 2013 23:45:57 +0000 (18:45 -0500)]
git-svn.txt: fix AsciiDoc formatting error
As asterisks are used to indicate bold text in AsciiDoc, shell glob
expressions must be escaped appropriately.
Signed-off-by: Keshav Kini <keshav.kini@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Nicolas Vigier [Mon, 30 Sep 2013 14:46:14 +0000 (16:46 +0200)]
git-svn: fix signed commit parsing
When parsing a commit object, git-svn wrongly think that a line
containing spaces means the end of headers and the start of the commit
message. In case of signed commit, the gpgsig entry contains a line with
one space, so "git svn dcommit" will include part of the signature in
the commit message.
An example of such problem :
http://svnweb.mageia.org/treasurer?view=revision&revision=86
This commit changes the regex to only match an empty line as separator
between the headers and the commit message.
Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Stefan Beller [Wed, 9 Oct 2013 14:35:11 +0000 (16:35 +0200)]
checkout test: enable test with complex relative path
This test was added, commented out, in
fed1b5ca (git-checkout: Test
for relative path use, 2007-11-09). Later git's path handling was
improved (
d089ebaa, setup: sanitize absolute and funny paths in
get_pathspec(), 2008-01-28) but we forgot to enable the now-working
test.
This test expects to run from a subdirectory, so add a 'cd'. While
we're here, examine the content of the checked-out file instead of
just checking that it exists. The other checkout tests already do the
same.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Tue, 8 Oct 2013 20:56:50 +0000 (13:56 -0700)]
Merge branch 'tz/credential-netrc'
* tz/credential-netrc:
git-credential-netrc: fix uninitialized warning
Ted Zlatanov [Tue, 8 Oct 2013 20:02:02 +0000 (16:02 -0400)]
git-credential-netrc: fix uninitialized warning
Simple patch to avoid unitialized warning and log what we'll do.
Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
John Keeping [Thu, 3 Oct 2013 19:17:32 +0000 (20:17 +0100)]
Documentation/Makefile: make AsciiDoc dblatex dir configurable
On my system this is in /usr/share/asciidoc/dblatex not
/etc/asciidoc/dblatex. Extract this portion of the path to a variable
so that is can be set in config.mak.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Kirill A. Shutemov [Sat, 28 Sep 2013 15:53:05 +0000 (18:53 +0300)]
rebase -i: respect core.abbrev
collapse_todo_ids() uses `git rev-parse --short=7' to abbreviate
commit ids before showing them to the user in a text editor. Let's
drop argument from --short to the configured value instead (still
defaulting to 7).
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Matthieu Moy [Thu, 26 Sep 2013 13:23:35 +0000 (15:23 +0200)]
RelNotes/1.8.5: direct script writers to "git status --porcelain"
[jn: with wording tweak from Keshav Kini]
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Philip Oakley [Sat, 21 Sep 2013 15:51:46 +0000 (16:51 +0100)]
remote set-head -h: add long options to synopsis
Document --auto and --delete alongside their short forms -a and -d in
the first line of 'git remote set-head -h' output.
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Philip Oakley [Sat, 21 Sep 2013 15:51:45 +0000 (16:51 +0100)]
remote doc: document long forms of set-head options
"git remote set-head" has always supported --add and --delete
as synonyms for the -a and -d option but forgot to document
them.
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Nguyễn Thái Ngọc Duy [Fri, 27 Sep 2013 13:48:13 +0000 (20:48 +0700)]
clone: tighten "local paths with colons" check a bit
commit
6000334 (clone: allow cloning local paths with colons in them -
2013-05-04) made it possible to specify a path that has colons in it
without file://, e.g. ../foo:bar/somewhere. But the check was a bit
sloppy.
Consider the url '[foo]:bar'. The '[]' unwrapping code will turn the
string to 'foo\0:bar'. In effect this new string is the same as
'foo/:bar' in the check "path < strchrnul(host, '/')", which mistakes
it for a local path (with '/' before the first ':') when it's actually
not.
So disable the check for '/' before ':' when the URL has been mangled
by '[]' unwrapping.
[jn: with tests from Jeff King]
Noticed-by: Morten Stenshorne <mstensho@opera.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Stefan Beller [Thu, 26 Sep 2013 20:33:02 +0000 (22:33 +0200)]
contrib: remove ciabot
Almost a year ago the CIA service irrevocably crashed. The CIA author
had plans to revive the service, but the effort has since sunk without
trace.
Projects tend to use "irker" instead these days. Repository hook
scripts for irker ship with the irker distribution.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Acked-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Thu, 26 Sep 2013 22:36:57 +0000 (15:36 -0700)]
Sync with Git 1.8.4.1
Jonathan Nieder [Thu, 26 Sep 2013 22:01:41 +0000 (15:01 -0700)]
Git 1.8.4.1
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
John Keeping [Thu, 26 Sep 2013 20:02:48 +0000 (21:02 +0100)]
merge-recursive: fix parsing of "diff-algorithm" option
The "diff-algorithm" option to the recursive merge strategy takes the
name of the algorithm as an option, but it uses strcmp on the option
string to check if it starts with "diff-algorithm=", meaning that this
options cannot actually be used.
Fix this by switching to prefixcmp. At the same time, clarify the
following line by using strlen instead of a hard-coded length, which
also makes it consistent with nearby code.
Reported-by: Luke Noel-Storr <luke.noel-storr@integrate.co.uk>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder [Thu, 26 Sep 2013 19:41:14 +0000 (12:41 -0700)]
Merge branch 'mm/rebase-continue-freebsd-WB' into maint
* mm/rebase-continue-freebsd-WB:
rebase: fix run_specific_rebase's use of "return" on FreeBSD
Jonathan Nieder [Thu, 26 Sep 2013 19:34:23 +0000 (12:34 -0700)]
Merge branch 'km/svn-1.8-serf-only' into maint
* km/svn-1.8-serf-only:
Git.pm: revert _temp_cache use of temp_is_locked
git-svn: allow git-svn fetching to work using serf
Git.pm: add new temp_is_locked function
Jonathan Nieder [Thu, 26 Sep 2013 19:30:44 +0000 (12:30 -0700)]
Merge branch 'js/xread-in-full' into maint
* js/xread-in-full:
stream_to_pack: xread does not guarantee to read all requested bytes
Jonathan Nieder [Thu, 26 Sep 2013 19:27:29 +0000 (12:27 -0700)]
Merge branch 'bc/send-email-ssl-die-message-fix' into maint
* bc/send-email-ssl-die-message-fix:
send-email: don't call methods on undefined values
Jonathan Nieder [Wed, 25 Sep 2013 06:36:08 +0000 (23:36 -0700)]
Merge branch 'bc/submodule-status-ignored'
* bc/submodule-status-ignored:
Improve documentation concerning the status.submodulesummary setting
submodule: don't print status output with ignore=all
submodule: fix confusing variable name
Jonathan Nieder [Wed, 25 Sep 2013 06:35:24 +0000 (23:35 -0700)]
Merge branch 'cc/replace-with-the-same-type'
* cc/replace-with-the-same-type:
Doc: 'replace' merge and non-merge commits
t6050-replace: use some long option names
replace: allow long option names
Documentation/replace: add Creating Replacement Objects section
t6050-replace: add test to clean up all the replace refs
t6050-replace: test that objects are of the same type
Documentation/replace: state that objects must be of the same type
replace: forbid replacing an object with one of a different type
Jonathan Nieder [Wed, 25 Sep 2013 06:31:58 +0000 (23:31 -0700)]
Merge branch 'kb/msvc-compile'
* kb/msvc-compile:
Windows: do not redefine _WIN32_WINNT
MinGW: Fix stat definitions to work with MinGW runtime version 4.0
MSVC: fix stat definition hell
MSVC: fix compile errors due to macro redefinitions
MSVC: fix compile errors due to missing libintl.h
Jonathan Nieder [Wed, 25 Sep 2013 06:29:55 +0000 (23:29 -0700)]
Merge branch 'nd/unpack-entry-optim-in-pack-objects'
* nd/unpack-entry-optim-in-pack-objects:
pack-objects: no crc check when the cached version is used
Jonathan Nieder [Wed, 25 Sep 2013 06:29:00 +0000 (23:29 -0700)]
Merge branch 'jk/shortlog-tolerate-broken-commit'
* jk/shortlog-tolerate-broken-commit:
shortlog: ignore commits with missing authors
Jonathan Nieder [Wed, 25 Sep 2013 06:28:13 +0000 (23:28 -0700)]
Merge branch 'jc/strcasecmp-pure-inline'
* jc/strcasecmp-pure-inline:
mailmap: work around implementations with pure inline strcasecmp
Jonathan Nieder [Wed, 25 Sep 2013 06:27:44 +0000 (23:27 -0700)]
Merge branch 'sg/complete-untracked-filter'
* sg/complete-untracked-filter:
completion: improve untracked directory filtering for filename completion
Jonathan Nieder [Wed, 25 Sep 2013 06:27:02 +0000 (23:27 -0700)]
Merge branch 'nd/fetch-pack-error-reporting-fix'
* nd/fetch-pack-error-reporting-fix:
fetch-pack.c: show correct command name that fails