Junio C Hamano [Mon, 11 May 2015 21:24:00 +0000 (14:24 -0700)]
Merge branch 'ep/do-not-feed-a-pointer-to-array-size'
Catch a programmer mistake to feed a pointer not an array to
ARRAY_SIZE() macro, by using a couple of GCC extensions.
* ep/do-not-feed-a-pointer-to-array-size:
git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array
Junio C Hamano [Mon, 11 May 2015 21:23:59 +0000 (14:23 -0700)]
Merge branch 'jc/hash-object'
"hash-object --literally" introduced in v2.2 was not prepared to
take a really long object type name.
* jc/hash-object:
write_sha1_file(): do not use a separate sha1[] array
t1007: add hash-object --literally tests
hash-object --literally: fix buffer overrun with extra-long object type
git-hash-object.txt: document --literally option
Junio C Hamano [Mon, 11 May 2015 21:23:57 +0000 (14:23 -0700)]
Merge branch 'sb/prefix-path-free-results'
Code clean-up (not a leak-fix).
* sb/prefix-path-free-results:
prefix_path(): unconditionally free results in the callers
Junio C Hamano [Mon, 11 May 2015 21:23:57 +0000 (14:23 -0700)]
Merge branch 'sg/completion-no-redundant-all-command-list'
Code simplification.
* sg/completion-no-redundant-all-command-list:
completion: remove redundant __git_compute_all_commands() call
Junio C Hamano [Mon, 11 May 2015 21:23:55 +0000 (14:23 -0700)]
Merge branch 'sg/complete-decorate-full-not-long'
The completion for "log --decorate=" parameter value was incorrect.
* sg/complete-decorate-full-not-long:
completion: fix and update 'git log --decorate=' options
Junio C Hamano [Mon, 11 May 2015 21:23:54 +0000 (14:23 -0700)]
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'
"filter-branch" corrupted commit log message that ends with an
incomplete line on platforms with some "sed" implementations that
munge such a line. Work it around by avoiding to use "sed".
* jk/filter-branch-use-of-sed-on-incomplete-line:
filter-branch: avoid passing commit message through sed
Junio C Hamano [Mon, 11 May 2015 21:23:53 +0000 (14:23 -0700)]
Merge branch 'jc/daemon-no-ipv6-for-2.4.1'
"git daemon" fails to build from the source under NO_IPV6
configuration (regression in 2.4).
* jc/daemon-no-ipv6-for-2.4.1:
daemon: unbreak NO_IPV6 build regression
Junio C Hamano [Mon, 11 May 2015 21:23:52 +0000 (14:23 -0700)]
Merge branch 'jn/clean-use-error-not-fprintf-on-stderr'
Some error messages in "git config" were emitted without calling
the usual error() facility.
* jn/clean-use-error-not-fprintf-on-stderr:
config: use error() instead of fprintf(stderr, ...)
Junio C Hamano [Mon, 11 May 2015 21:23:52 +0000 (14:23 -0700)]
Merge branch 'tb/blame-resurrect-convert-to-git'
Some time ago, "git blame" (incorrectly) lost the convert_to_git()
call when synthesizing a fake "tip" commit that represents the
state in the working tree, which broke folks who record the history
with LF line ending to make their project portabile across
platforms while terminating lines in their working tree files with
CRLF for their platform.
* tb/blame-resurrect-convert-to-git:
blame: CRLF in the working tree and LF in the repo
Junio C Hamano [Mon, 11 May 2015 21:23:51 +0000 (14:23 -0700)]
Merge branch 'va/fix-git-p4-tests'
* va/fix-git-p4-tests:
git-p4: t9814: prevent --chain-lint failure
Junio C Hamano [Mon, 11 May 2015 21:23:50 +0000 (14:23 -0700)]
Merge branch 'ld/p4-case-fold'
* ld/p4-case-fold:
git-p4: add failing tests for case-folding p4d
Junio C Hamano [Mon, 11 May 2015 21:23:49 +0000 (14:23 -0700)]
Merge branch 'jk/rebase-quiet-noop'
"git rebase --quiet" was not quite quiet when there is nothing to
do.
* jk/rebase-quiet-noop:
rebase: silence "git checkout" for noop rebase
Junio C Hamano [Mon, 11 May 2015 21:23:48 +0000 (14:23 -0700)]
Merge branch 'va/p4-client-path'
git p4 attempts to better handle branches in Perforce.
* va/p4-client-path:
git-p4: improve client path detection when branches are used
t9801: check git-p4's branch detection with client spec enabled
Junio C Hamano [Mon, 11 May 2015 21:23:47 +0000 (14:23 -0700)]
Merge branch 'mm/add-p-split-error'
When "add--interactive" splits a hunk into two overlapping hunks
and then let the user choose only one, it sometimes feeds an
incorrect patch text to "git apply". Add tests to demonstrate
this.
I have a slight suspicion that this may be $gmane/87202 coming back
and biting us (I seem to have said "let's run with this and see
what happens" back then).
* mm/add-p-split-error:
stash -p: demonstrate failure of split with mixed y/n
t3904-stash-patch: factor PERL prereq at the top of the file
t3904-stash-patch: fix test description
add -p: demonstrate failure when running 'edit' after a split
t3701-add-interactive: simplify code
Junio C Hamano [Mon, 11 May 2015 21:23:47 +0000 (14:23 -0700)]
Merge branch 'tb/t0027-crlf'
More line-ending tests.
* tb/t0027-crlf:
t0027: Add repoMIX and LF_nul
t0027: support NATIVE_CRLF platforms
t0027: cleanup: rename functions; avoid non-leading TABs
Junio C Hamano [Mon, 11 May 2015 21:23:46 +0000 (14:23 -0700)]
Merge branch 'ls/p4-changes-block-size'
"git p4" learned "--changes-block-size <n>" to read the changes in
chunks from Perforce, instead of making one call to "p4 changes"
that may trigger "too many rows scanned" error from Perforce.
* ls/p4-changes-block-size:
git-p4: use -m when running p4 changes
Junio C Hamano [Mon, 11 May 2015 21:23:45 +0000 (14:23 -0700)]
Merge branch 'jc/plug-fmt-merge-msg-leak'
* jc/plug-fmt-merge-msg-leak:
fmt-merge-msg: plug small leak of commit buffer
Junio C Hamano [Mon, 11 May 2015 21:23:44 +0000 (14:23 -0700)]
Merge branch 'nd/slim-index-pack-memory-usage'
Memory usage of "git index-pack" has been trimmed by tens of
per-cent.
* nd/slim-index-pack-memory-usage:
index-pack: kill union delta_base to save memory
index-pack: reduce object_entry size to save memory
Junio C Hamano [Mon, 11 May 2015 21:23:43 +0000 (14:23 -0700)]
Merge branch 'jk/still-interesting'
"git rev-list --objects $old --not --all" to see if everything that
is reachable from $old is already connected to the existing refs
was very inefficient.
* jk/still-interesting:
limit_list: avoid quadratic behavior from still_interesting
Junio C Hamano [Mon, 11 May 2015 21:23:42 +0000 (14:23 -0700)]
Merge branch 'jk/reading-packed-refs'
An earlier rewrite to use strbuf_getwholeline() instead of fgets(3)
to read packed-refs file revealed that the former is unacceptably
inefficient.
* jk/reading-packed-refs:
t1430: add another refs-escape test
read_packed_refs: avoid double-checking sane refs
strbuf_getwholeline: use getdelim if it is available
strbuf_getwholeline: avoid calling strbuf_grow
strbuf_addch: avoid calling strbuf_grow
config: use getc_unlocked when reading from file
strbuf_getwholeline: use getc_unlocked
git-compat-util: add fallbacks for unlocked stdio
strbuf_getwholeline: use getc macro
Junio C Hamano [Mon, 11 May 2015 21:23:42 +0000 (14:23 -0700)]
Merge branch 'lm/squelch-bg-progress'
Many long-running operations show progress eye-candy, even when
they are later backgrounded. Hide the eye-candy when the process
is sent to the background instead.
* lm/squelch-bg-progress:
compat/mingw: stubs for getpgid() and tcgetpgrp()
progress: no progress in background
Junio C Hamano [Mon, 11 May 2015 21:23:40 +0000 (14:23 -0700)]
Merge branch 'jk/sha1-file-reduce-useless-warnings'
* jk/sha1-file-reduce-useless-warnings:
sha1_file: squelch "packfile cannot be accessed" warnings
Junio C Hamano [Mon, 11 May 2015 21:23:39 +0000 (14:23 -0700)]
Merge branch 'nd/multiple-work-trees'
A replacement for contrib/workdir/git-new-workdir that does not
rely on symbolic links and make sharing of objects and refs safer
by making the borrowee and borrowers aware of each other.
* nd/multiple-work-trees: (41 commits)
prune --worktrees: fix expire vs worktree existence condition
t1501: fix test with split index
t2026: fix broken &&-chain
t2026 needs procondition SANITY
git-checkout.txt: a note about multiple checkout support for submodules
checkout: add --ignore-other-wortrees
checkout: pass whole struct to parse_branchname_arg instead of individual flags
git-common-dir: make "modules/" per-working-directory directory
checkout: do not fail if target is an empty directory
t2025: add a test to make sure grafts is working from a linked checkout
checkout: don't require a work tree when checking out into a new one
git_path(): keep "info/sparse-checkout" per work-tree
count-objects: report unused files in $GIT_DIR/worktrees/...
gc: support prune --worktrees
gc: factor out gc.pruneexpire parsing code
gc: style change -- no SP before closing parenthesis
checkout: clean up half-prepared directories in --to mode
checkout: reject if the branch is already checked out elsewhere
prune: strategies for linked checkouts
checkout: support checking out into a new working directory
...
Junio C Hamano [Mon, 11 May 2015 21:23:38 +0000 (14:23 -0700)]
Merge branch 'pt/credential-xdg'
Tweak the sample "store" backend of the credential helper to honor
XDG configuration file locations when specified.
* pt/credential-xdg:
t0302: "unreadable" test needs POSIXPERM
t0302: test credential-store support for XDG_CONFIG_HOME
git-credential-store: support XDG_CONFIG_HOME
git-credential-store: support multiple credential files
Junio C Hamano [Wed, 6 May 2015 04:13:30 +0000 (21:13 -0700)]
First batch for 2.5 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 6 May 2015 04:00:37 +0000 (21:00 -0700)]
Merge branch 'jk/prune-mtime'
Access to objects in repositories that borrow from another one on a
slow NFS server unnecessarily got more expensive due to recent code
becoming more cautious in a naive way not to lose objects to pruning.
* jk/prune-mtime:
sha1_file: only freshen packs once per run
sha1_file: freshen pack objects before loose
reachable: only mark local objects as recent
Junio C Hamano [Wed, 6 May 2015 04:00:36 +0000 (21:00 -0700)]
Merge branch 'mm/usage-log-l-can-take-regex'
Documentation fix.
* mm/usage-log-l-can-take-regex:
log -L: improve error message on malformed argument
Documentation: change -L:<regex> to -L:<funcname>
Junio C Hamano [Wed, 6 May 2015 04:00:35 +0000 (21:00 -0700)]
Merge branch 'ep/fix-test-lib-functions-report'
* ep/fix-test-lib-functions-report:
test-lib-functions.sh: fix the second argument to some helper functions
Junio C Hamano [Wed, 6 May 2015 04:00:34 +0000 (21:00 -0700)]
Merge branch 'cn/bom-in-gitignore'
Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.
* cn/bom-in-gitignore:
attr: skip UTF8 BOM at the beginning of the input file
config: use utf8_bom[] from utf.[ch] in git_parse_source()
utf8-bom: introduce skip_utf8_bom() helper
add_excludes_from_file: clarify the bom skipping logic
dir: allow a BOM at the beginning of exclude files
Junio C Hamano [Wed, 6 May 2015 04:00:33 +0000 (21:00 -0700)]
Merge branch 'jc/epochtime-wo-tz'
"git commit --date=now" or anything that relies on approxidate lost
the daylight-saving-time offset.
* jc/epochtime-wo-tz:
parse_date_basic(): let the system handle DST conversion
parse_date_basic(): return early when given a bogus timestamp
Junio C Hamano [Wed, 6 May 2015 04:00:31 +0000 (21:00 -0700)]
Merge branch 'nd/t1509-chroot-test'
Correct test bitrot.
* nd/t1509-chroot-test:
t1509: update prepare script to be able to run t1509 in chroot again
Junio C Hamano [Wed, 6 May 2015 04:00:30 +0000 (21:00 -0700)]
Merge branch 'oh/fix-config-default-user-name-section'
The default $HOME/.gitconfig file created upon "git config --global"
that edits it had incorrectly spelled user.name and user.email
entries in it.
* oh/fix-config-default-user-name-section:
config: fix settings in default_user_config template
Junio C Hamano [Wed, 6 May 2015 04:00:29 +0000 (21:00 -0700)]
Merge branch 'jk/type-from-string-gently'
"git cat-file bl $blob" failed to barf even though there is no
object type that is "bl".
* jk/type-from-string-gently:
type_from_string_gently: make sure length matches
Junio C Hamano [Wed, 6 May 2015 04:00:28 +0000 (21:00 -0700)]
Merge branch 'sb/test-bitmap-free-at-end'
* sb/test-bitmap-free-at-end:
pack-bitmap.c: fix a memleak
Junio C Hamano [Wed, 6 May 2015 04:00:27 +0000 (21:00 -0700)]
Merge branch 'ld/p4-filetype-detection'
* ld/p4-filetype-detection:
git-p4: fix filetype detection on files opened exclusively
git-p4: small fix for locked-file-move-test
git-p4: fix small bug in locked test scripts
Junio C Hamano [Wed, 6 May 2015 04:00:27 +0000 (21:00 -0700)]
Merge branch 'ts/checkout-advice-plural'
* ts/checkout-advice-plural:
checkout: call a single commit "it" intead of "them"
Junio C Hamano [Wed, 6 May 2015 04:00:26 +0000 (21:00 -0700)]
Merge branch 'jk/init-core-worktree-at-root'
We avoid setting core.worktree when the repository location is the
".git" directory directly at the top level of the working tree, but
the code misdetected the case in which the working tree is at the
root level of the filesystem (which arguably is a silly thing to
do, but still valid).
* jk/init-core-worktree-at-root:
init: don't set core.worktree when initializing /.git
Junio C Hamano [Wed, 6 May 2015 04:00:25 +0000 (21:00 -0700)]
Merge branch 'mh/show-branch-topic'
"git show-branch --topics HEAD" (with no other arguments) did not
do anything interesting. Instead, contrast the given revision
against all the local branches by default.
* mh/show-branch-topic:
show-branch: show all local heads when only giving one rev along --topics
Junio C Hamano [Wed, 6 May 2015 04:00:25 +0000 (21:00 -0700)]
Merge branch 'sb/line-log-plug-pairdiff-leak'
* sb/line-log-plug-pairdiff-leak:
line-log.c: fix a memleak
Junio C Hamano [Wed, 6 May 2015 04:00:24 +0000 (21:00 -0700)]
Merge branch 'jc/diff-no-index-d-f'
The usual "git diff" when seeing a file turning into a directory
showed a patchset to remove the file and create all files in the
directory, but "git diff --no-index" simply refused to work. Also,
when asked to compare a file and a directory, imitate POSIX "diff"
and compare the file with the file with the same name in the
directory, instead of refusing to run.
* jc/diff-no-index-d-f:
diff-no-index: align D/F handling with that of normal Git
diff-no-index: DWIM "diff D F" into "diff D/F F"
Junio C Hamano [Wed, 6 May 2015 04:00:23 +0000 (21:00 -0700)]
Merge branch 'bc/object-id'
Identify parts of the code that knows that we use SHA-1 hash to
name our objects too much, and use (1) symbolic constants instead
of hardcoded 20 as byte count and/or (2) use struct object_id
instead of unsigned char [20] for object names.
* bc/object-id:
apply: convert threeway_stage to object_id
patch-id: convert to use struct object_id
commit: convert parts to struct object_id
diff: convert struct combine_diff_path to object_id
bulk-checkin.c: convert to use struct object_id
zip: use GIT_SHA1_HEXSZ for trailers
archive.c: convert to use struct object_id
bisect.c: convert leaf functions to use struct object_id
define utility functions for object IDs
define a structure for object IDs
Elia Pinto [Thu, 30 Apr 2015 12:44:14 +0000 (14:44 +0200)]
git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array
To get number of elements in an array git use the ARRAY_SIZE macro
defined as:
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
The problem with it is a possibility of mistakenly passing to it a
pointer instead an array. The ARRAY_SIZE macro as conventionally
defined does not provide good type-safety and the open-coded
approach is more fragile, more verbose and provides no improvement in
type-safety.
Use instead a different but compatible ARRAY_SIZE() macro,
which will also break compile if you try to
use it on a pointer. This implemention revert to the original code
if the compiler doesn't know the typeof and __builtin_types_compatible_p
GCC extensions.
This can ensure our code is robust to changes, without
needing a gratuitous macro or constant. A similar
ARRAY_SIZE implementation also exists in the linux kernel.
Credits to Rusty Russell and his ccan library.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 5 May 2015 18:03:24 +0000 (11:03 -0700)]
daemon: unbreak NO_IPV6 build regression
When
01cec54e (daemon: deglobalize hostname information, 2015-03-07)
wrapped the global variables such as hostname inside a struct, it
forgot to convert one location that spelled "hostname" that needs to
be updated to "hi->hostname".
This was inside NO_IPV6 block, and was not caught by anybody.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Mon, 4 May 2015 19:11:54 +0000 (12:11 -0700)]
prefix_path(): unconditionally free results in the callers
As of
d089ebaa (setup: sanitize absolute and funny paths in
get_pathspec(), 2008-01-28), prefix_path() always returns a
newly allocated string, so callers should free its result.
Additionally, drop the const from variables to which the result of
the prefix_path() is assigned, so they can be free()'d without
having to cast-away the constness.
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 4 May 2015 18:08:10 +0000 (11:08 -0700)]
write_sha1_file(): do not use a separate sha1[] array
In the beginning, write_sha1_file() did not have a way to tell the
caller the name of the object it wrote to the caller. This was
changed in
d6d3f9d0 (This implements the new "recursive tree"
write-tree., 2005-04-09) by adding the "returnsha1" parameter to the
function so that the callers who are interested in the value can
optionally pass a pointer to receive it.
It turns out that all callers do want to know the name of the object
it just has written. Nobody passes a NULL to this parameter, hence
it is not necessary to use a separate sha1[] array to receive the
result from write_sha1_file_prepare(), and copy the result to the
returnsha1 supplied by the caller.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Mon, 4 May 2015 07:25:14 +0000 (03:25 -0400)]
t1007: add hash-object --literally tests
git-hash-object learned a --literally option in
5ba9a93
(hash-object: add --literally option, 2014-09-11). Check that
--literally allows object creation with a bogus type, with two
type strings whose length is reasonably short and very long.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Mon, 4 May 2015 07:25:15 +0000 (03:25 -0400)]
hash-object --literally: fix buffer overrun with extra-long object type
"hash-object" learned in
5ba9a93 (hash-object: add --literally
option, 2014-09-11) to allow crafting a corrupt/broken object of
unknown type.
When the user-provided type is particularly long, however, it can
overflow the relatively small stack-based character array handed to
write_sha1_file_prepare() by hash_sha1_file() and write_sha1_file(),
leading to stack corruption (and crash). Introduce a custom helper
to allow arbitrarily long typenames just for "hash-object --literally".
[jc: Eric's original used a strbuf in the more common codepaths, and
I rewrote it to avoid penalizing the non-literally code. Bugs are mine]
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder [Mon, 4 May 2015 21:18:39 +0000 (14:18 -0700)]
config: use error() instead of fprintf(stderr, ...)
The die() / error() / warning() helpers put a fatal: / error: /
warning: prefix in front of the error message they print describing
the message's severity, which users are likely to be accustomed to
seeing these days.
This change will also be useful when marking the message for
translation: the argument to error() includes no newline at the end,
so it is less fussy for translators to translate without lines running
together in the translated output.
While we're here, start the error messages with a lowercase letter to
match the usual typography of error messages.
A quick web search and a code search at codesearch.debian.net finds no
scripts trying to parse these error messages, so this change should be
safe.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Mon, 4 May 2015 07:25:13 +0000 (03:25 -0400)]
git-hash-object.txt: document --literally option
Document the git-hash-object --literally option added by
5ba9a93
(hash-object: add --literally option, 2014-09-11).
While here, also correct a minor typesetting oversight.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor [Fri, 1 May 2015 17:21:00 +0000 (19:21 +0200)]
completion: fix and update 'git log --decorate=' options
'git log --decorate=' understands the 'full', 'short' and 'no' options.
From these the completion script only offered 'short' and it offered
'long' instead of 'full'.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor [Fri, 1 May 2015 15:48:56 +0000 (17:48 +0200)]
completion: remove redundant __git_compute_all_commands() call
During lazy-initialization of the lists of all commands and porcelain
commands the function __git_compute_all_commands() is called twice. The
relevant part of the call sequence looks like this:
__git_compute_porcelain_commands()
__git_compute_all_commands()
<finds list of all commands uninitialized>
__git_list_all_commands()
<initializes list of all commands>
__git_list_porcelain_commands()
__git_compute_all_commands()
<finds list of all commands already initialized, does nothing>
<filters porcelains from list of all commands>
Either one of the two calls could be removed and the initialization of
both command lists would still work as a whole, but let's remove the call
from __git_compute_porcelain_commands(), because this way
__git_list_porcelain_commands() will keep working in itself.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen [Sun, 3 May 2015 16:38:01 +0000 (18:38 +0200)]
blame: CRLF in the working tree and LF in the repo
A typical setup under Windows is to set core.eol to CRLF, and text
files are marked as "text" in .gitattributes, or core.autocrlf is
set to true.
After
4d4813a5 "git blame" no longer works as expected for such a
set-up. Every line is annotated as "Not Committed Yet", even though
the working directory is clean. This is because the commit removed
the conversion in blame.c for all files, with or without CRLF in the
repo.
Having files with CRLF in the repo and core.autocrlf=input is a
temporary situation, and the files, if committed as is, will be
normalized in the repo, which _will_ be a notable change. Blaming
them with "Not Committed Yet" is the right result. Revert commit
4d4813a5 which was a misguided attempt to "solve" a non-problem.
Add two test cases in t8003 to verify the correct CRLF conversion.
Suggested-By: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 30 Apr 2015 18:25:06 +0000 (11:25 -0700)]
Git 2.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 29 Apr 2015 15:48:58 +0000 (11:48 -0400)]
filter-branch: avoid passing commit message through sed
On some systems (like OS X), if sed encounters input without
a trailing newline, it will silently add it. As a result,
"git filter-branch" on such systems may silently rewrite
commit messages that omit a trailing newline. Even though
this is not something we generate ourselves with "git
commit", it's better for filter-branch to preserve the
original data as closely as possible.
We're using sed here only to strip the header fields from
the commit object. We can accomplish the same thing with a
shell loop. Since shell "read" calls are slow (usually one
syscall per byte), we use "cat" once we've skipped past the
header. Depending on the size of your commit messages, this
is probably faster (you pay the cost to fork, but then read
the data in saner-sized chunks). This idea is shamelessly
stolen from Junio.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 28 Apr 2015 20:01:29 +0000 (13:01 -0700)]
Merge branch 'mh/multimail-renewal'
* mh/multimail-renewal:
Update git-multimail to version 1.0.2
Junio C Hamano [Tue, 28 Apr 2015 20:00:20 +0000 (13:00 -0700)]
Merge branch 'mg/show-notes-doc'
Documentation fix.
* mg/show-notes-doc:
rev-list-options.txt: complete sentence about notes matching
Junio C Hamano [Tue, 28 Apr 2015 20:00:19 +0000 (13:00 -0700)]
Merge branch 'nd/versioncmp-prereleases'
* nd/versioncmp-prereleases:
git tag: mention versionsort.prereleaseSuffix in manpage
Junio C Hamano [Tue, 28 Apr 2015 20:00:18 +0000 (13:00 -0700)]
Merge branch 'mg/status-v-v'
* mg/status-v-v:
status: document the -v/--verbose option
Luke Diamand [Tue, 28 Apr 2015 09:08:01 +0000 (10:08 +0100)]
git-p4: add failing tests for case-folding p4d
When p4d runs on a case-folding OS, git-p4 can end up getting
very confused. This adds failing tests to demonstrate the problem.
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Diamand [Tue, 28 Apr 2015 07:21:22 +0000 (08:21 +0100)]
git-p4: t9814: prevent --chain-lint failure
Use test_lazy_prereq to setup prerequisites for the p4 move
test. This both makes the test simpler and clearer, and also
means it no longer fails the new --chain-lint tests.
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 28 Apr 2015 05:17:37 +0000 (01:17 -0400)]
rebase: silence "git checkout" for noop rebase
When the branch to be rebased is already up to date, we
"git checkout" the branch, print an "up to date" message,
and end the rebase early. However, our checkout may print
"Switched to branch 'foo'" or "Already on 'foo'", even if
the user has asked for "--quiet".
We should avoid printing these messages at all, "--quiet" or
no. Since the rebase is a noop, this checkout can be seen as
optimizing out these other two checkout operations (that
happen in a real rebase):
1. Moving to the detached HEAD to start the rebase; we
always feed "-q" to checkout there, and instead rely on
our own custom message (which respects --quiet).
2. Finishing a rebase, where we move to the final branch.
Here we actually use update-ref rather than
git-checkout, and produce no messages.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Mon, 27 Apr 2015 11:17:25 +0000 (13:17 +0200)]
Update git-multimail to version 1.0.2
The only changes are to the README files, most notably the list of
maintainers and the project URL.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 27 Apr 2015 19:26:21 +0000 (12:26 -0700)]
Sync with 2.3.7
Junio C Hamano [Mon, 27 Apr 2015 19:25:36 +0000 (12:25 -0700)]
Git 2.3.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 27 Apr 2015 19:23:53 +0000 (12:23 -0700)]
Merge branch 'tb/connect-ipv6-parse-fix' into maint
An earlier update to the parser that disects a URL broke an
address, followed by a colon, followed by an empty string (instead
of the port number), e.g. ssh://example.com:/path/to/repo.
* tb/connect-ipv6-parse-fix:
connect.c: ignore extra colon after hostname
Junio C Hamano [Mon, 27 Apr 2015 19:23:51 +0000 (12:23 -0700)]
Merge branch 'ma/bash-completion-leaking-x' into maint
The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.
* ma/bash-completion-leaking-x:
completion: fix global bash variable leak on __gitcompappend
Junio C Hamano [Mon, 27 Apr 2015 19:23:47 +0000 (12:23 -0700)]
Merge branch 'jc/push-cert' into maint
The "git push --signed" protocol extension did not limit what the
"nonce" that is a server-chosen string can contain or how long it
can be, which was unnecessarily lax. Limit both the length and the
alphabet to a reasonably small space that can still have enough
entropy.
* jc/push-cert:
push --signed: tighten what the receiving end can ask to sign
Torsten Bögershausen [Sat, 25 Apr 2015 06:47:13 +0000 (08:47 +0200)]
t0027: Add repoMIX and LF_nul
"new safer autocrlf handling":
- Check if eols in a file are converted at commit, when the file has
CR (or CRLF) in the repo (technically speaking in the index).
- Add a test-file repoMIX with mixed line-endings.
- When converting LF->CRLF or CRLF->LF: check the warnings
checkout_files():
- Checking out CRLF_nul and checking for eol coversion does not
make much sense (CRLF will stay CRLF).
- Use the file LF_nul instead: It is handled a binary in "auto" modes,
and when declared as text the LF may be replaced with CRLF, depending
on the configuration.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Thu, 23 Apr 2015 12:27:46 +0000 (14:27 +0200)]
status: document the -v/--verbose option
Document `git status -v`, including its new doubled `-vv` form.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Thu, 23 Apr 2015 12:27:50 +0000 (14:27 +0200)]
RelNotes: wordsmithing
Make many textual tweaks to the 2.4.0 release notes.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Thu, 23 Apr 2015 12:27:49 +0000 (14:27 +0200)]
RelNotes: refer to the rebase -i "todo list", not "insn sheet"
"Todo list" is the name that is used in the user-facing documentation.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Thu, 23 Apr 2015 12:27:48 +0000 (14:27 +0200)]
RelNotes: correct name of versionsort.prereleaseSuffix
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Thu, 23 Apr 2015 12:27:47 +0000 (14:27 +0200)]
git tag: mention versionsort.prereleaseSuffix in manpage
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vitor Antunes [Tue, 21 Apr 2015 22:49:30 +0000 (23:49 +0100)]
git-p4: improve client path detection when branches are used
Perforce allows client side file/directory remapping through
the use of the client view definition that is part of the
user's client spec.
To support this functionality while branch detection is
enabled it is important to determine the branch location in
the workspace such that the correct files are patched before
Perforce submission. Perforce provides a command that
facilitates this process: p4 where.
This patch does two things to fix improve file location
detection when git-p4 has branch detection and use of client
spec enabled:
1. Enable usage of "p4 where" when Perforce branches exist
in the git repository, even when client specification is
used. This makes use of the already existing function
p4Where.
2. Allow identifying partial matches of the branch's depot
path while processing the output of "p4 where". For
robustness, paths will only match if ending in "/...".
Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 22 Apr 2015 20:52:43 +0000 (13:52 -0700)]
Git 2.4.0-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vitor Antunes [Tue, 21 Apr 2015 22:49:29 +0000 (23:49 +0100)]
t9801: check git-p4's branch detection with client spec enabled
Add failing scenario when branch detection (--detect-branches) is
enabled together with use client spec (--use-client-spec). In this
specific scenario git-p4 will break when the Perforce client view
removes part of the depot path, as in the following example:
//depot/branch1/base/... //client/branch1/...
The test case also includes an extra sub-file mapping to enforce
robustness check of git-p4's client view support:
//depot/branch1/base/dir/sub_file1 //client/branch1/sub_file1
Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 21 Apr 2015 19:58:50 +0000 (12:58 -0700)]
Sync with maint
Junio C Hamano [Tue, 21 Apr 2015 19:17:09 +0000 (12:17 -0700)]
Git 2.3.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 21 Apr 2015 19:12:25 +0000 (12:12 -0700)]
Merge branch 'jk/colors' into maint
"diff-highlight" (in contrib/) used to show byte-by-byte
differences, which meant that multi-byte characters can be chopped
in the middle. It learned to pay attention to character boundaries
(assuming the UTF-8 payload).
* jk/colors:
diff-highlight: do not split multibyte characters
Junio C Hamano [Tue, 21 Apr 2015 19:12:24 +0000 (12:12 -0700)]
Merge branch 'jk/test-annoyances' into maint
Test fixes.
* jk/test-annoyances:
t5551: make EXPENSIVE test cheaper
t5541: move run_with_cmdline_limit to test-lib.sh
t: pass GIT_TRACE through Apache
t: redirect stderr GIT_TRACE to descriptor 4
t: translate SIGINT to an exit
Junio C Hamano [Tue, 21 Apr 2015 19:12:23 +0000 (12:12 -0700)]
Merge branch 'pt/enter-repo-comment-fix' into maint
Documentation update.
* pt/enter-repo-comment-fix:
enter_repo(): fix docs to match code
Junio C Hamano [Tue, 21 Apr 2015 19:12:22 +0000 (12:12 -0700)]
Merge branch 'jz/gitweb-conf-doc-fix' into maint
Documentation update.
* jz/gitweb-conf-doc-fix:
gitweb.conf.txt: say "build-time", not "built-time"
Junio C Hamano [Tue, 21 Apr 2015 19:12:21 +0000 (12:12 -0700)]
Merge branch 'jk/cherry-pick-docfix' into maint
* jk/cherry-pick-docfix:
cherry-pick: fix docs describing handling of empty commits
Junio C Hamano [Tue, 21 Apr 2015 19:12:20 +0000 (12:12 -0700)]
Merge branch 'iu/fix-parse-options-h-comment' into maint
* iu/fix-parse-options-h-comment:
parse-options.h: OPTION_{BIT,SET_INT} do not store pointer to defval
Junio C Hamano [Tue, 21 Apr 2015 19:12:19 +0000 (12:12 -0700)]
Merge branch 'jg/cguide-we-cannot-count' into maint
* jg/cguide-we-cannot-count:
CodingGuidelines: update 'rough' rule count
Junio C Hamano [Tue, 21 Apr 2015 19:12:18 +0000 (12:12 -0700)]
Merge branch 'jk/pack-corruption-post-mortem' into maint
Documentation update.
* jk/pack-corruption-post-mortem:
howto: document more tools for recovery corruption
Junio C Hamano [Tue, 21 Apr 2015 19:12:17 +0000 (12:12 -0700)]
Merge branch 'jn/doc-fast-import-no-16-octopus-limit' into maint
Documentation update.
* jn/doc-fast-import-no-16-octopus-limit:
fast-import doc: remove suggested 16-parent limit
Junio C Hamano [Tue, 21 Apr 2015 18:09:19 +0000 (11:09 -0700)]
RelNotes: "merge --quiet" change has been reverted
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 20 Apr 2015 22:30:13 +0000 (15:30 -0700)]
Hopefully the last batch for 2.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 20 Apr 2015 22:28:34 +0000 (15:28 -0700)]
Merge branch 'ps/grep-help-all-callback-arg'
Code clean-up.
* ps/grep-help-all-callback-arg:
grep: correctly initialize help-all option
Junio C Hamano [Mon, 20 Apr 2015 22:28:33 +0000 (15:28 -0700)]
Merge branch 'tb/connect-ipv6-parse-fix'
An earlier update to the parser that disects an address broke an
address, followed by a colon, followed by an empty string (instead
of the port number).
* tb/connect-ipv6-parse-fix:
connect.c: ignore extra colon after hostname
Junio C Hamano [Mon, 20 Apr 2015 22:28:32 +0000 (15:28 -0700)]
Merge branch 'va/fix-git-p4-tests'
Test fixes for git-p4.
* va/fix-git-p4-tests:
t9814: guarantee only one source exists in git-p4 copy tests
git-p4: fix copy detection test
t9814: fix broken shell syntax in git-p4 rename test
Junio C Hamano [Mon, 20 Apr 2015 22:28:31 +0000 (15:28 -0700)]
Merge branch 'jc/push-cert'
The "git push --signed" protocol extension did not limit what the
"nonce" that is a server-chosen string can contain or how long it
can be, which was unnecessarily lax. Limit both the length and the
alphabet to a reasonably small space that can still have enough
entropy.
* jc/push-cert:
push --signed: tighten what the receiving end can ask to sign
Junio C Hamano [Mon, 20 Apr 2015 22:28:29 +0000 (15:28 -0700)]
Merge branch 'ma/bash-completion-leaking-x'
The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.
* ma/bash-completion-leaking-x:
completion: fix global bash variable leak on __gitcompappend
Junio C Hamano [Wed, 15 Apr 2015 21:18:37 +0000 (14:18 -0700)]
fmt-merge-msg: plug small leak of commit buffer
A broken or badly formatted commit might not record author or
committer lines or we may not find a valid name on them. The
function record_person() returned after calling get_commit_buffer()
without calling unuse_commit_buffer() on the memory it obtained in
such cases, potentially leaking it.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Mon, 20 Apr 2015 19:55:00 +0000 (15:55 -0400)]
sha1_file: only freshen packs once per run
Since
33d4221 (write_sha1_file: freshen existing objects,
2014-10-15), we update the mtime of existing objects that we
would have written out (had they not existed). For the
common case in which many objects are packed, we may update
the mtime on a single packfile repeatedly. This can result
in a noticeable performance problem if calling utime() is
expensive (e.g., because your storage is on NFS).
We can fix this by keeping a per-pack flag that lets us
freshen only once per program invocation.
An alternative would be to keep the packed_git.mtime flag up
to date as we freshen, and freshen only once every N
seconds. In practice, it's not worth the complexity. We are
racing against prune expiration times here, which inherently
must be set to accomodate reasonable program running times
(because they really care about the time between an object
being written and it becoming referenced, and the latter is
typically the last step a program takes).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Mon, 20 Apr 2015 19:54:03 +0000 (15:54 -0400)]
sha1_file: freshen pack objects before loose
When writing out an object file, we first check whether it
already exists and if so optimize out the write. Prior to
33d4221, we did this by calling has_sha1_file(), which will
check for packed objects followed by loose. Since that
commit, we check loose objects first.
For the common case of a repository whose objects are mostly
packed, this means we will make a lot of extra access()
system calls checking for loose objects. We should follow
the same packed-then-loose order that all of our other
lookups use.
Reported-by: Stefan Saasen <ssaasen@atlassian.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 27 Mar 2015 11:32:41 +0000 (07:32 -0400)]
reachable: only mark local objects as recent
When pruning and repacking a repository that has an
alternate object store configured, we may traverse a large
number of objects in the alternate. This serves no purpose,
and may be expensive to do. A longer explanation is below.
Commits
d3038d2 and
abcb865 taught prune and pack-objects
(respectively) to treat "recent" objects as tips for
reachability, so that we keep whole chunks of history. They
built on the object traversal in
660c889 (sha1_file: add
for_each iterators for loose and packed objects,
2014-10-15), which covers both local and alternate objects.
In both cases, covering alternate objects is unnecessary, as
both commands can only drop objects from the local
repository. In the case of prune, we traverse only the local
object directory. And in the case of repacking, while we may
or may not include local objects in our pack, we will never
reach into the alternate with "repack -d". The "-l" option
is only a question of whether we are migrating objects from
the alternate into our repository, or leaving them
untouched.
It is possible that we may drop an object that is depended
upon by another object in the alternate. For example,
imagine two repositories, A and B, with A pointing to B as
an alternate. Now imagine a commit that is in B which
references a tree that is only in A. Traversing from recent
objects in B might prevent A from dropping that tree. But
this case isn't worth covering. Repo B should take
responsibility for its own objects. It would never have had
the commit in the first place if it did not also have the
tree, and assuming it is using the same "keep recent chunks
of history" scheme, then it would itself keep the tree, as
well.
So checking the alternate objects is not worth doing, and
come with a significant performance impact. In both cases,
we skip any recent objects that have already been marked
SEEN (i.e., that we know are already reachable for prune, or
included in the pack for a repack). So there is a slight
waste of time in opening the alternate packs at all, only to
notice that we have already considered each object. But much
worse, the alternate repository may have a large number of
objects that are not reachable from the local repository at
all, and we end up adding them to the traversal.
We can fix this by considering only local unseen objects.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lex Spoon [Mon, 20 Apr 2015 15:00:20 +0000 (11:00 -0400)]
git-p4: use -m when running p4 changes
Simply running "p4 changes" on a large branch can result in a "too
many rows scanned" error from the Perforce server. It is better to
use a sequence of smaller calls to "p4 changes", using the "-m"
option to limit the size of each call.
Signed-off-by: Lex Spoon <lex@lexspoon.org>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy [Mon, 20 Apr 2015 12:09:07 +0000 (14:09 +0200)]
log -L: improve error message on malformed argument
The old message did not mention the :regex:file form.
To avoid overly long lines, split the message into two lines (in case
item->string is long, it will be the only part truncated in a narrow
terminal).
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>