Jeff King [Tue, 29 Oct 2013 16:30:37 +0000 (12:30 -0400)]
subtree: add makefile target for html docs
The Makefile currently builds the roff manpage, but not the
html form. As some people may prefer the latter, let's make
it an option to build that, too. We also wire it into "make
doc" so that it is built by default.
This patch does not build or install it as part of
"install-doc"; that would require extra infrastructure to
handle installing the html as we do in git's regular
Documentation/ tree. That can come later if somebody is
interested.
Tested-by: Sebastian Schuberth <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brian Gernhardt [Mon, 21 Oct 2013 17:54:12 +0000 (13:54 -0400)]
t5570: Update for clone-progress-to-stderr branch
git clone now reports its progress to standard error, which throws off
t5570. Using test_i18ngrep instead of test_cmp allows the test to be
more flexible by only looking for the expected error and ignoring any
other output from the program.
Signed-off-by: Brian Gernhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ben Walton [Mon, 28 Oct 2013 21:43:00 +0000 (21:43 +0000)]
Avoid difference in tr semantics between System V and BSD
Solaris' tr (both /usr/bin/ and /usr/xpg4/bin) uses the System V
semantics for tr whereby string1's length is truncated to the length
of string2 if string2 is shorter. The BSD semantics, as used by GNU tr
see string2 padded to the length of string1 using the final character
in string2. POSIX explicitly doesn't specify the correct behavior
here, making both equally valid.
This difference means that Solaris' native tr implementations produce
different results for tr ":\t\n" "\0" than GNU tr. This breaks a few
tests in t0008-ignores.sh.
Possible fixes for this are to make string2 be "\0\0\0" or "[\0*]".
Instead, use perl to perform these transliterations which means we
don't need to worry about the difference at all. Since we're replacing
tr with perl, we also use perl to replace the sed invocations used to
transform the files.
Replace four identical transforms with a function named
broken_c_unquote. Replace the other two identical transforms with a
fuction named broken_c_unquote_verbose.
Signed-off-by: Ben Walton <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Wed, 30 Oct 2013 06:50:16 +0000 (02:50 -0400)]
for-each-ref: avoid loading objects to print %(objectname)
If you ask for-each-ref to print each ref and its object,
like:
git for-each-ref --format='%(objectname) %(refname)'
this should involve little more work than looking at the ref
files (and packed-refs) themselves. However, for-each-ref
will actually load each object from disk just to print its
sha1. For most repositories, this isn't a big deal, but it
can be noticeable if you have a large number of refs to
print. Here are best-of-five timings for the command above
on a repo with ~10K refs:
[before]
real 0m0.112s
user 0m0.092s
sys 0m0.016s
[after]
real 0m0.014s
user 0m0.012s
sys 0m0.000s
This patch checks for %(objectname) and %(objectname:short)
before we actually parse the object (and the rest of the
code is smart enough to avoid parsing if we have filled all
of our placeholders).
Note that we can't simply move the objectname parsing code
into the early loop. If the "deref" form %(*objectname) is
used, then we do need to parse the object in order to peel
the tag. So instead of moving the code, we factor it out
into a separate function that can be called for both cases.
While we're at it, we add some basic tests for the
dereferenced placeholders, which were not tested at all
before. This helps ensure we didn't regress that case.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Anders Kaseorg [Wed, 30 Oct 2013 08:44:43 +0000 (04:44 -0400)]
cvsserver: Determinize output to combat Perl 5.18 hash randomization
Perl 5.18 randomizes the seed used by its hash function, so iterating
through hashes results in different orders from run to run:
http://perldoc.perl.org/perl5180delta.html#Hash-overhaul
This usually broke t9400 (gitcvs.dbname, gitcvs.ext.dbname, when
running cmp on two .sqlite files) and t9402 (check [cvswork3] diff,
when running test_cmp on two diffs).
To fix this, hide the internal order of hashes with sort when sending
output or running database queries.
(An alternative workaround is PERL_HASH_SEED=0, but this seems nicer.)
Signed-off-by: Anders Kaseorg <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 23:47:32 +0000 (16:47 -0700)]
merge-base: teach "--fork-point" mode
The "git pull --rebase" command computes the fork point of the
branch being rebased using the reflog entries of the "base" branch
(typically a remote-tracking branch) the branch's work was based on,
in order to cope with the case in which the "base" branch has been
rewound and rebuilt. For example, if the history looked like this:
o---B1
/
---o---o---B2--o---o---o---Base
\
B3
\
Derived
where the current tip of the "base" branch is at Base, but earlier
fetch observed that its tip used to be B3 and then B2 and then B1
before getting to the current commit, and the branch being rebased
on top of the latest "base" is based on commit B3, it tries to find
B3 by going through the output of "git rev-list --reflog base" (i.e.
Base, B1, B2, B3) until it finds a commit that is an ancestor of the
current tip "Derived".
Internally, we have get_merge_bases_many() that can compute this
with one-go. We would want a merge-base between Derived and a
fictitious merge commit that would result by merging all the
historical tips of "base". When such a commit exist, we should get
a single result, which exactly match one of the reflog entries of
"base".
Teach "git merge-base" a new mode, "--fork-point", to compute
exactly that.
Helped-by: Martin von Zweigbergk <redacted>
Helped-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Tue, 29 Oct 2013 01:23:03 +0000 (21:23 -0400)]
t: use perl instead of "$PERL_PATH" where applicable
As of the last commit, we can use "perl" instead of
"$PERL_PATH" when running tests, as the former is now a
function which uses the latter. As the shorter "perl" is
easier on the eyes, let's switch to using it everywhere.
This is not quite a mechanical s/$PERL_PATH/perl/
replacement, though. There are some places where we invoke
perl from a script we generate on the fly, and those scripts
do not have access to our internal shell functions. The
result can be double-checked by running:
ln -s /bin/false bin-wrappers/perl
make test
which continues to pass even after this patch.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Tue, 29 Oct 2013 01:22:07 +0000 (21:22 -0400)]
t: provide a perl() function which uses $PERL_PATH
Once upon a time, we assumed that calling a bare "perl" in
the test scripts was OK, because we would find the perl from
the user's PATH, and we were only asking that perl to do
basic operations that work even on old versions of perl.
Later, we found that some systems really prefer to use
$PERL_PATH even for these basic cases, because the system
perl misbehaves in some way (e.g., by handling line endings
differently). We then switched "perl" invocations to
"$PERL_PATH" to respect the user's choice.
Having to use "$PERL_PATH" is ugly and cumbersome, though.
Instead, let's provide a perl() shell function that tests
can use, which will transparently do the right thing.
Unfortunately, test writers still have to use $PERL_PATH in
certain situations, so we still need to keep the advice in
the README.
Note that this may fix test failures in t5004, t5503, t6002,
t6003, t6300, t8001, and t8002, depending on your system's
perl setup. All of these can be detected by running:
ln -s /bin/false bin-wrappers/perl
make test
which fails before this patch, and passes after.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Tue, 29 Oct 2013 01:19:59 +0000 (21:19 -0400)]
use @@PERL@@ in built scripts
Several of the built shell commands invoke a bare "perl" to
perform some one-liners. This will use the first perl in the
PATH rather than the one specified by the user's SHELL_PATH.
We are not asking these perl invocations to do anything
exotic, so typically any old system perl will do; however,
in some cases the system perl may have unexpected behavior
(e.g., by handling line endings differently). We should err
on the side of using the perl the user pointed us to.
The downside of this is that on systems with a sane perl
setup, we no longer find the perl at runtime, but instead
point to a static perl (like /usr/bin/perl). That means we
will not handle somebody moving perl without rebuilding git,
whereas before we tracked it just fine. This is probably not
a big deal, though, as the built perl scripts already
suffered from this.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Sitaram Chamarty [Sat, 21 Sep 2013 02:23:06 +0000 (07:53 +0530)]
doc/howto: warn about (dumb)http server document being too old
Describe when it is still applicable, and tell people where to go
for most normal cases.
Signed-off-by: Sitaram Chamarty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Mon, 28 Oct 2013 19:22:16 +0000 (12:22 -0700)]
t/README: tests can use perl even with NO_PERL
The git build system supports a NO_PERL switch to avoid installing
perl bindings or other features (like "git add --patch") that rely on
perl on runtime, but even with NO_PERL it has not been possible for a
long time to run tests without perl. Helpers such as
nul_to_q () {
"$PERL_PATH" -pe 'y/\000/Q/'
}
use perl as a better tr or sed and are regularly used in tests without
worrying to add a PERL prerequisite.
Perl is portable enough that it seems fine to keep relying on it for
this kind of thing in tests (and more readable than the alternative of
trying to find POSIXy equivalents). Update the test documentation to
clarify this.
Reported-by: Johannes Sixt <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 28 Oct 2013 17:52:07 +0000 (10:52 -0700)]
Almost -rc0 for 1.8.5
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 28 Oct 2013 17:51:53 +0000 (10:51 -0700)]
Sync with v1.8.4.2
Junio C Hamano [Mon, 28 Oct 2013 17:43:41 +0000 (10:43 -0700)]
Merge branch 'sb/repack-in-c'
Finishing touches to update documentation.
* sb/repack-in-c:
Reword repack documentation to no longer state it's a script
Junio C Hamano [Mon, 28 Oct 2013 17:43:38 +0000 (10:43 -0700)]
Merge branch 'sg/prompt-svn-remote-fix'
Bash portability fix.
* sg/prompt-svn-remote-fix:
bash prompt: don't use '+=' operator in show upstream code path
Junio C Hamano [Mon, 28 Oct 2013 17:43:32 +0000 (10:43 -0700)]
Merge branch 'jk/split-broken-ident'
Make the fall-back parsing of commit objects with broken author or
committer lines more robust to pick up the timestamps.
* jk/split-broken-ident:
split_ident: parse timestamp from end of line
Junio C Hamano [Mon, 28 Oct 2013 17:43:28 +0000 (10:43 -0700)]
Merge branch 'jk/remote-literal-string-leakfix'
* jk/remote-literal-string-leakfix:
remote: do not copy "origin" string literal
Junio C Hamano [Mon, 28 Oct 2013 17:43:24 +0000 (10:43 -0700)]
Merge branch 'ew/keepalive'
* ew/keepalive:
http: use curl's tcp keepalive if available
http: enable keepalive on TCP sockets
Junio C Hamano [Mon, 28 Oct 2013 17:43:16 +0000 (10:43 -0700)]
Merge branch 'jc/revision-range-unpeel'
"git rev-list --objects ^v1.0^ v1.0" gave v1.0 tag itself in the
output, but "git rev-list --objects v1.0^..v1.0" did not.
* jc/revision-range-unpeel:
revision: do not peel tags used in range notation
Junio C Hamano [Mon, 28 Oct 2013 17:42:29 +0000 (10:42 -0700)]
Merge branch 'jx/relative-path-regression-fix'
* jx/relative-path-regression-fix:
Use simpler relative_path when set_git_dir
relative_path should honor dos-drive-prefix
test: use unambigous leading path (/foo) for MSYS
Junio C Hamano [Mon, 28 Oct 2013 17:21:29 +0000 (10:21 -0700)]
Git 1.8.4.2
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 28 Oct 2013 17:19:24 +0000 (10:19 -0700)]
Merge branch 'jk/clone-progress-to-stderr' into maint
"git clone" gave some progress messages to the standard output, not to
the standard error, and did not allow suppressing them with the
"--no-progress" option.
* jk/clone-progress-to-stderr:
clone: always set transport options
clone: treat "checking connectivity" like other progress
clone: send diagnostic messages to stderr
Junio C Hamano [Mon, 28 Oct 2013 17:18:43 +0000 (10:18 -0700)]
Merge branch 'jk/format-patch-from' into maint
"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 [Mon, 28 Oct 2013 17:17:31 +0000 (10:17 -0700)]
Merge branch 'jk/shortlog-tolerate-broken-commit' into maint
"git shortlog" used to choke and die when there is a malformed commit
(e.g. missing authors); it now simply ignore such a commit and keeps
going.
* jk/shortlog-tolerate-broken-commit:
shortlog: ignore commits with missing authors
Junio C Hamano [Mon, 28 Oct 2013 17:16:11 +0000 (10:16 -0700)]
Merge branch 'jk/diff-algo' into maint
"git merge-recursive" did not parse its "--diff-algorithm=" command
line option correctly.
* jk/diff-algo:
merge-recursive: fix parsing of "diff-algorithm" option
Nguyễn Thái Ngọc Duy [Sat, 26 Oct 2013 02:09:20 +0000 (09:09 +0700)]
pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses
Normally parse_pathspec() is used on command line arguments where it
can do fancy thing like parsing magic on each argument or adding magic
for all pathspecs based on --*-pathspecs options.
There's another use of parse_pathspec(), where pathspec is needed, but
the input is known to be pure paths. In this case we usually don't
want --*-pathspecs to interfere. And we definitely do not want to
parse magic in these paths, regardless of --literal-pathspecs.
Add new flag PATHSPEC_LITERAL_PATH for this purpose. When it's set,
--*-pathspecs are ignored, no magic is parsed. And if the caller
allows PATHSPEC_LITERAL (i.e. the next calls can take literal magic),
then PATHSPEC_LITERAL will be set.
This fixes cases where git chokes when GIT_*_PATHSPECS are set because
parse_pathspec() indicates it won't take any magic. But
GIT_*_PATHSPECS add them anyway. These are
export GIT_LITERAL_PATHSPECS=1
git blame -- something
git log --follow something
git log --merge
"git ls-files --with-tree=path" (aka parse_pathspec() in
overlay_tree_on_cache()) is safe because the input is empty, and
producing one pathspec due to PATHSPEC_PREFER_CWD does not take any
magic into account.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Sun, 27 Oct 2013 11:35:43 +0000 (12:35 +0100)]
sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs
There are cases (e.g. when running concurrent fetches in a repo) where
multiple Git processes concurrently attempt to create loose objects
within the same objects/XX/ dir. The creation of the loose object files
is (AFAICS) safe from races, but the creation of the objects/XX/ dir in
which the loose objects reside is unsafe, for example:
Two concurrent fetches - A and B. As part of its fetch, A needs to store
12aaaaa as a loose object. B, on the other hand, needs to store
12bbbbb
as a loose object. The objects/12 directory does not already exist.
Concurrently, both A and B determine that they need to create the
objects/12 directory (because their first call to git_mkstemp_mode()
within create_tmpfile() fails witn ENOENT). One of them - let's say A -
executes the following mkdir() call before the other. This first call
returns success, and A moves on. When B gets around to calling mkdir(),
it fails with EEXIST, because A won the race. The mkdir() error causes B
to return -1 from create_tmpfile(), which propagates all the way,
resulting in the fetch failing with:
error: unable to create temporary file: File exists
fatal: failed to write object
fatal: unpack-objects failed
Although it's hard to add a testcase reproducing this issue, it's easy
to provoke if we insert a sleep after the
if (mkdir(buffer, 0777) || adjust_shared_perm(buffer))
return -1;
block, and then run two concurrent "git fetch"es against the same repo.
The fix is to simply handle mkdir() failing with EEXIST as a success.
If EEXIST is somehow returned for the wrong reasons (because the relevant
objects/XX is not a directory, or is otherwise unsuitable for object
storage), the following call to adjust_shared_perm(), or ultimately the
retried call to git_mkstemp_mode() will fail, and we end up returning
error from create_tmpfile() in any case.
Note that there are still cases where two users with unsuitable umasks
in a shared repo can end up in two races where one user first wins the
mkdir() race to create an objects/XX/ directory, and then the other user
wins the adjust_shared_perms() race to chmod() that directory, but fails
because it is (transiently, until the first users completes its chmod())
unwriteable to the other user. However, (an equivalent of) this race also
exists before this patch, and is made no worse by this patch.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ben Walton [Sun, 27 Oct 2013 21:26:48 +0000 (21:26 +0000)]
Change sed i\ usage to something Solaris' sed can handle
Solaris' sed was choking on the i\ commands used in
t4015-diff-whitespace as it couldn't parse the program properly.
Modify two uses of sed that worked in GNU sed but not Solaris'
(/usr/bin or /usr/xpg4/bin) to an equivalent form that is handled
properly by both.
Signed-off-by: Ben Walton <redacted>
Signed-off-by: Junio C Hamano <redacted>
Torstein Hegge [Sun, 27 Oct 2013 09:56:33 +0000 (10:56 +0100)]
test-lib: fix typo in comment
Point test writers to the test_expect_* functions properly.
Signed-off-by: Torstein Hegge <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Sat, 26 Oct 2013 22:34:30 +0000 (00:34 +0200)]
sha1_file: move comment about return value where it belongs
Commit
5b0864070 (sha1_object_info_extended: make type calculation
optional, Jul 12 2013) changed the return value of the
sha1_object_info_extended function to 0/-1 for success/error.
Previously this function returned the object type for success or
-1 for error. But unfortunately the above commit forgot to change
or move the comment above this function that says "returns enum
object_type or negative".
To fix this inconsistency, let's move the comment above the
sha1_object_info function where it is still true.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Sixt [Sat, 26 Oct 2013 19:17:16 +0000 (21:17 +0200)]
tests: undo special treatment of CRLF for Windows
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Sixt [Sat, 26 Oct 2013 19:17:15 +0000 (21:17 +0200)]
Windows: a test_cmp that is agnostic to random LF <> CRLF conversions
In a number of tests, output that was produced by a shell script is
compared to expected output using test_cmp. Unfortunately, the MSYS bash--
when invoked via git, such as in hooks--converts LF to CRLF on output
(as produced by echo and printf), which leads to many false positives.
Implements a diff tool that undoes the converted CRLF. To avoid that
sub-processes are spawned (which is very slow on Windows), the tool is
implemented as a shell function. Diff is invoked as usual only when a
difference is detected by the shell code.
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Sixt [Sat, 26 Oct 2013 19:17:14 +0000 (21:17 +0200)]
t5300-pack-object: do not compare binary data using test_cmp
Users may set test_cmp to a comparison tool of their liking. The intent is
that the tool performs comparison of line-oriented texts. However, t5300
uses it also to compare binary data. Change those tests to use 'cmp'.
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stefan Beller [Sat, 26 Oct 2013 17:03:02 +0000 (19:03 +0200)]
cache: remove unused function 'have_git_dir'
This function was added in
d2b0708 (2008-09-27, add have_git_dir()
function) as a preparation for
adbc0b6 (2008-09-30, cygwin: Use native
Win32 API for stat).
However the second referenced commit was reverted in
f66450a (2013-06-22,
cygwin: Remove the Win32 l/stat() implementation), so we don't need to
expose this wrapper function any more as a public API.
Signed-off-by: Stefan Beller <redacted>
Acked-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stefan Beller [Sat, 26 Oct 2013 17:03:01 +0000 (19:03 +0200)]
refs: remove unused function invalidate_ref_cache
The function 'invalidate_ref_cache' was introduced in
79c7ca5 (2011-10-17,
invalidate_ref_cache(): rename function from invalidate_cached_refs())
by a rename and elevated to be publicly usable in
8be8bde (2011-10-17,
invalidate_ref_cache(): expose this function in the refs API)
However it is not used anymore, as
8bf90dc (2011-10-17, write_ref_sha1():
only invalidate the loose ref cache) and (much) later
506a760 (2013-04-22,
refs: change how packed refs are deleted) removed any calls to this
function. So it seems as if we don't need that function any more,
good bye!
Signed-off-by: Stefan Beller <redacted>
Acked-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Fri, 25 Oct 2013 07:55:02 +0000 (03:55 -0400)]
howto: add article on recovering a corrupted object
This is an asciidoc-ified version of a corruption post-mortem sent to
the git list. It complements the existing howto article, since it covers
a case where the object couldn't be easily recreated or copied from
elsewhere.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Fri, 25 Oct 2013 06:54:06 +0000 (02:54 -0400)]
reset: pass real rev name to add--interactive
The add--interactive --patch mode adjusts the UI based on
whether we are pulling changes from HEAD or elsewhere (in
the former case it asks to unstage the reverse hunk, rather
than apply the forward hunk).
Commit
166ec2e taught reset to work on an unborn branch, but
in doing so, switched to always providing add--interactive
with the sha1 rather than the symbolic name. This meant we
always used the "apply" interface, even for "git reset -p
HEAD".
We can fix this by passing the symbolic name to
add--interactive. Since it understands unborn branches
these days, we do not even have to cover this special case
ourselves; we can simply pass HEAD.
The tests in t7105 now check that the right interface is
used in each circumstance (and notice the regression from
166ec2e we are fixing). The test in t7106 checks that we
get this right for the unborn case, too (not a regression,
since it didn't work at all before, but a nice improvement).
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Fri, 25 Oct 2013 06:52:30 +0000 (02:52 -0400)]
add-interactive: handle unborn branch in patch mode
The list_modified function already knows how to handle an
unborn branch by diffing against the empty tree. However,
the diff we perform to get the actual hunks does not. Let's
use the same logic for both diffs.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Vicent Marti [Thu, 24 Oct 2013 18:01:47 +0000 (14:01 -0400)]
sha1_file: export `git_open_noatime`
The `git_open_noatime` helper can be of general interest for other
consumers of git's different on-disk formats.
Signed-off-by: Vicent Marti <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Vicent Marti [Thu, 24 Oct 2013 18:01:41 +0000 (14:01 -0400)]
revision: allow setting custom limiter function
This commit enables users of `struct rev_info` to peform custom limiting
during a revision walk (i.e. `get_revision`).
If the field `include_check` has been set to a callback, this callback
will be issued once for each commit before it is added to the "pending"
list of the revwalk. If the include check returns 0, the commit will be
marked as added but won't be pushed to the pending list, effectively
limiting the walk.
Signed-off-by: Vicent Marti <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Vicent Marti [Thu, 24 Oct 2013 18:01:29 +0000 (14:01 -0400)]
pack-objects: factor out name_hash
As the pack-objects system grows beyond the single
pack-objects.c file, more parts (like the soon-to-exist
bitmap code) will need to compute hashes for matching
deltas. Factor out name_hash to make it available to other
files.
Signed-off-by: Vicent Marti <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Vicent Marti [Thu, 24 Oct 2013 18:01:06 +0000 (14:01 -0400)]
pack-objects: refactor the packing list
The hash table that stores the packing list for a given `pack-objects`
run was tightly coupled to the pack-objects code.
In this commit, we refactor the hash table and the underlying storage
array into a `packing_data` struct. The functionality for accessing and
adding entries to the packing list is hence accessible from other parts
of Git besides the `pack-objects` builtin.
This refactoring is a requirement for further patches in this series
that will require accessing the commit packing list from outside of
`pack-objects`.
The hash table implementation has been minimally altered: we now
use table sizes which are always a power of two, to ensure a uniform
index distribution in the array.
Signed-off-by: Vicent Marti <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Vicent Marti [Thu, 24 Oct 2013 18:00:36 +0000 (14:00 -0400)]
revindex: export new APIs
Allow users to efficiently lookup consecutive entries that are expected
to be found on the same revindex by exporting `find_revindex_position`:
this function takes a pointer to revindex itself, instead of looking up
the proper revindex for a given packfile on each call.
Signed-off-by: Vicent Marti <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 17:59:49 +0000 (13:59 -0400)]
sha1write: make buffer const-correct
We are passed a "void *" and write it out without ever
touching it; let's indicate that by using "const".
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:54:53 +0000 (04:54 -0400)]
checkout: do not die when leaving broken detached HEAD
If we move away from a detached HEAD that has broken or
corrupted commits, we might die in two places:
1. Printing the "old HEAD was..." message.
2. Printing the list of orphaned commits.
In both cases, we ignore the return value of parse_commit
and feed the resulting commit to the pretty-print machinery,
which will die() upon failing to read the commit object
itself.
Since both cases are ancillary to the real operation being
performed, let's be more robust and keep going. This lets
users more easily checkout away from broken history.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:54:01 +0000 (04:54 -0400)]
use parse_commit_or_die instead of custom message
Many calls to parse_commit detect errors and die. In some
cases, the custom error messages are more useful than what
parse_commit_or_die could produce, because they give some
context, like which ref the commit came from. Some, however,
just say "invalid commit". Let's convert the latter to use
parse_commit_or_die; its message is slightly more informative,
and it makes the error more consistent throughout git.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:53:46 +0000 (04:53 -0400)]
use parse_commit_or_die instead of segfaulting
Some unchecked calls to parse_commit should obviously die on
error, because their next step is to start looking at the
parsed fields, which will cause a segfault. These are
obvious candidates for parse_commit_or_die, which will be a
strict improvement in behavior.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:53:19 +0000 (04:53 -0400)]
assume parse_commit checks for NULL commit
The parse_commit function will check whether it was passed a
NULL commit pointer, and if so, return an error. There is no
need for callers to check this separately.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:53:01 +0000 (04:53 -0400)]
assume parse_commit checks commit->object.parsed
The parse_commit function will check the "parsed" flag of
the object and do nothing if it is set. There is no need
for callers to check the flag themselves, and doing so only
clutters the code.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:52:36 +0000 (04:52 -0400)]
log_tree_diff: die when we fail to parse a commit
We currently call parse_commit and then assume we can
dereference the resulting "tree" struct field. If parsing
failed, however, that field is NULL and we end up
segfaulting.
Instead of a segfault, let's print an error message and die
a little more gracefully.
Note that this should never happen in practice, but may
happen in a corrupt repository.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:45:13 +0000 (04:45 -0400)]
silence gcc array-bounds warning
In shorten_unambiguous_ref, we build and cache a reverse-map of the
rev-parse rules like this:
static char **scanf_fmts;
static int nr_rules;
if (!nr_rules) {
for (; ref_rev_parse_rules[nr_rules]; nr_rules++)
... generate scanf_fmts ...
}
where ref_rev_parse_rules is terminated with a NULL pointer.
Compiling with "gcc -O2 -Wall" does not cause any problems, but
compiling with "-O3 -Wall" generates:
$ make CFLAGS='-O3 -Wall' refs.o
refs.c: In function ‘shorten_unambiguous_ref’:
refs.c:3379:29: warning: array subscript is above array bounds [-Warray-bounds]
for (; ref_rev_parse_rules[nr_rules]; nr_rules++)
Curiously, we can silence this by explicitly nr_rules to 0
in the beginning of the loop, even though the compiler
should be able to tell that we follow this code path only
when nr_rules is already 0.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 24 Oct 2013 08:42:17 +0000 (04:42 -0400)]
drop redundant semicolon in empty while
The extra semi-colon is harmless, since we really do want
the while loop to do nothing. But it does trigger a warning
from clang.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 17:52:42 +0000 (10:52 -0700)]
checkout_entry(): clarify the use of topath[] parameter
The said function has this signature:
extern int checkout_entry(struct cache_entry *ce,
const struct checkout *state,
char *topath);
At first glance, it might appear that the caller of checkout_entry()
can specify to which path the contents are written out by the last
parameter, and it is tempting to add "const" in front of its type.
In reality, however, topath[] is to point at a buffer to store the
temporary path generated by the callchain originating from this
function, and the temporary path is always short, much shorter than
the buffer prepared by its only caller in builtin/checkout-index.c.
Document the code a bit to clarify so that future callers know how
to use the function better.
Noticed-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nguyễn Thái Ngọc Duy [Thu, 24 Oct 2013 01:55:35 +0000 (08:55 +0700)]
entry.c: convert checkout_entry to use strbuf
The old code does not do boundary check so any paths longer than
PATH_MAX can cause buffer overflow. Replace it with strbuf to handle
paths of arbitrary length.
The OS may reject if the path is too long though. But in that case we
report the cause (e.g. name too long) and usually move on to checking
out the next entry.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ramsay Jones [Thu, 24 Oct 2013 20:17:19 +0000 (21:17 +0100)]
http.c: Spell the null pointer as NULL
Commit
1bbcc224 ("http: refactor options to http_get_*", 28-09-2013)
changed the type of final 'options' argument of the http_get_file()
function from an int to an 'struct http_get_options' pointer.
However, it neglected to update the (single) call site. Since this
call was passing '0' to that argument, it was (correctly) being
interpreted as a null pointer. Change to argument to NULL.
Noticed by sparse. ("Using plain integer as NULL pointer")
Signed-off-by: Ramsay Jones <redacted>
Acked-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Haggerty [Wed, 23 Oct 2013 15:50:38 +0000 (17:50 +0200)]
get_ref_map(): rename local variables
Rename "refs" -> "refspecs" and "ref_count" -> "refspec_count" to
reduce confusion, because they describe an array of "struct refspec",
as opposed to the "struct ref" objects that are also used in this
function.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Haggerty [Wed, 23 Oct 2013 15:50:37 +0000 (17:50 +0200)]
api-remote.txt: correct section "struct refspec"
* Replace reference to function parse_ref_spec() with references to
functions parse_fetch_refspec() and parse_push_refspec().
* Correct description of src and dst: they *do* include the '*'
characters.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Haggerty [Wed, 23 Oct 2013 15:50:36 +0000 (17:50 +0200)]
t5510: check that "git fetch --prune --tags" does not prune branches
"git fetch --prune --tags" is currently interpreted as follows:
* "--tags" is equivalent to specifying a refspec
"refs/tags/*:refs/tags/*", and supersedes any default refspecs
configured via remote.$REMOTE.fetch.
* "--prune" only operates on the refspecs being fetched.
Therefore, "git fetch --prune --tags" prunes tags in refs/tags/* but
does not fetch or prune other references. The fact that this command
does not prune references outside of refs/tags/* was previously
untested. So add a test that verifies the status quo.
However, the status quo is surprising, so it will be changed later in
this patch series.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Haggerty [Wed, 23 Oct 2013 15:50:35 +0000 (17:50 +0200)]
t5510: prepare test refs more straightforwardly
"git fetch" was being used with contrived refspecs to create tags and
remote-tracking branches in test repositories in preparation for the
actual tests. This is obscure and also makes one wonder whether this
is indeed just preparation or whether some side-effect of "git fetch"
is being tested.
So use the more straightforward commands "git tag" / "git update-ref"
when preparing branches in test repositories.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Haggerty [Wed, 23 Oct 2013 15:50:34 +0000 (17:50 +0200)]
t5510: use the correct tag name in test
Fix an apparent copy-paste error: A few lines earlier, a tag
"refs/tags/sometag" is created. Check for the (non-)existence of that
tag, not "somebranch", which is otherwise never mentioned in the
script.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 23:10:25 +0000 (16:10 -0700)]
merge-base: use OPT_CMDMODE and clarify the command line parsing
The --octopus, --independent and --is-ancestor are mutually
exclusive command modes (in addition to not giving any of these
options), so represent them as such using the recent OPT_CMDMODE
facility available since
11588263 (parse-options: add OPT_CMDMODE(),
2013-07-30), which is in
v1.8.4-82-g366b80b. --all is compatible
only with plain vanilla mode and --octopus mode, and the minimum
number of arguments the command takes depends on the command modes,
so these are now separately checked in each command mode.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 20:37:27 +0000 (13:37 -0700)]
Update draft release notes to 1.8.5
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 20:36:57 +0000 (13:36 -0700)]
Sync with 'maint'
Junio C Hamano [Wed, 23 Oct 2013 20:34:39 +0000 (13:34 -0700)]
Almost 1.8.4.2 ;-)
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 23 Oct 2013 20:33:08 +0000 (13:33 -0700)]
Merge branch 'jc/ls-files-killed-optim' into maint
"git ls-files -k" needs to crawl only the part of the working tree
that may overlap the paths in the index to find killed files, but
shared code with the logic to find all the untracked files, which
made it unnecessarily inefficient.
* jc/ls-files-killed-optim:
dir.c::test_one_path(): work around directory_exists_in_index_icase() breakage
t3010: update to demonstrate "ls-files -k" optimization pitfalls
ls-files -k: a directory only can be killed if the index has a non-directory
dir.c: use the cache_* macro to access the current index
Junio C Hamano [Wed, 23 Oct 2013 20:32:50 +0000 (13:32 -0700)]
Merge branch 'jh/checkout-auto-tracking' into maint
"git branch --track" had a minor regression in v1.8.3.2 and later
that made it impossible to base your local work on anything but a
local branch of the upstream repository you are tracking from.
* jh/checkout-auto-tracking:
t3200: fix failure on case-insensitive filesystems
branch.c: Relax unnecessary requirement on upstream's remote ref name
t3200: Add test demonstrating minor regression in
41c21f2
Refer to branch.<name>.remote/merge when documenting --track
t3200: Minor fix when preparing for tracking failure
t2024: Fix &&-chaining and a couple of typos
Junio C Hamano [Wed, 23 Oct 2013 20:32:17 +0000 (13:32 -0700)]
Merge branch 'nd/fetch-into-shallow' into maint
When there is no sufficient overlap between old and new history
during a "git fetch" into a shallow repository, objects that the
sending side knows the receiving end has were unnecessarily sent.
* nd/fetch-into-shallow:
Add testcase for needless objects during a shallow fetch
list-objects: mark more commits as edges in mark_edges_uninteresting
list-objects: reduce one argument in mark_edges_uninteresting
upload-pack: delegate rev walking in shallow fetch to pack-objects
shallow: add setup_temporary_shallow()
shallow: only add shallow graft points to new shallow file
move setup_alternate_shallow and write_shallow_commits to shallow.c
Junio C Hamano [Wed, 23 Oct 2013 20:21:50 +0000 (13:21 -0700)]
Merge branch 'bc/gnome-keyring'
Cleanups and tweaks for credential handling to work with ancient versions
of the gnome-keyring library that are still in use.
* bc/gnome-keyring:
contrib/git-credential-gnome-keyring.c: support really ancient gnome-keyring
contrib/git-credential-gnome-keyring.c: support ancient gnome-keyring
contrib/git-credential-gnome-keyring.c: report failure to store password
contrib/git-credential-gnome-keyring.c: use glib messaging functions
contrib/git-credential-gnome-keyring.c: use glib memory allocation functions
contrib/git-credential-gnome-keyring.c: use secure memory for reading passwords
contrib/git-credential-gnome-keyring.c: use secure memory functions for passwds
contrib/git-credential-gnome-keyring.c: use gnome helpers in keyring_object()
contrib/git-credential-gnome-keyring.c: set Gnome application name
contrib/git-credential-gnome-keyring.c: ensure buffer is non-empty before accessing
contrib/git-credential-gnome-keyring.c: strlen() returns size_t, not ssize_t
contrib/git-credential-gnome-keyring.c: exit non-zero when called incorrectly
contrib/git-credential-gnome-keyring.c: add static where applicable
contrib/git-credential-gnome-keyring.c: *style* use "if ()" not "if()" etc.
contrib/git-credential-gnome-keyring.c: remove unused die() function
contrib/git-credential-gnome-keyring.c: remove unnecessary pre-declarations
Junio C Hamano [Wed, 23 Oct 2013 20:21:48 +0000 (13:21 -0700)]
Merge branch 'po/dot-url'
Explain how '.' can be used to refer to the "current repository"
in the documentation.
* po/dot-url:
doc/cli: make "dot repository" an independent bullet point
config doc: update dot-repository notes
doc: command line interface (cli) dot-repository dwimmery
Junio C Hamano [Wed, 23 Oct 2013 20:21:45 +0000 (13:21 -0700)]
Merge branch 'jc/prompt-upstream'
An enhancement to the GIT_PS1_SHOWUPSTREAM facility.
* jc/prompt-upstream:
git-prompt.sh: optionally show upstream branch name
Junio C Hamano [Wed, 23 Oct 2013 20:21:35 +0000 (13:21 -0700)]
Merge branch 'hu/cherry-pick-previous-branch'
"git cherry-pick" without further options would segfault.
Could use a follow-up to handle '-' after argv[1] better.
* hu/cherry-pick-previous-branch:
cherry-pick: handle "-" after parsing options
Junio C Hamano [Wed, 23 Oct 2013 20:21:30 +0000 (13:21 -0700)]
Merge branch 'mg/more-textconv'
Make "git grep" and "git show" pay attention to --textconv when
dealing with blob objects.
* mg/more-textconv:
grep: honor --textconv for the case rev:path
grep: allow to use textconv filters
t7008: demonstrate behavior of grep with textconv
cat-file: do not die on --textconv without textconv filters
show: honor --textconv for blobs
diff_opt: track whether flags have been set explicitly
t4030: demonstrate behavior of show with textconv
Junio C Hamano [Wed, 23 Oct 2013 20:21:26 +0000 (13:21 -0700)]
Merge branch 'jc/pack-objects'
* jc/pack-objects:
pack-objects: shrink struct object_entry
Antoine Pelisse [Wed, 23 Oct 2013 15:44:11 +0000 (08:44 -0700)]
remote-hg: unquote C-style paths when exporting
git-fast-import documentation says that paths can be C-style quoted.
Unfortunately, the current remote-hg helper doesn't unquote quoted
path and pass them as-is to Mercurial when the commit is created.
This results in the following situation:
- clone a mercurial repository with git
- add a file with space in a directory: `>dir/foo\ bar`
- commit that new file, and push the change to mercurial
- the mercurial repository now has a new directory named '"dir',
which contains a file named 'foo bar"'
Use Python str.decode('string-escape') to unquote the string if it
starts and ends with ". It has been tested with quotes, spaces, and
utf-8 encoded file-names.
Signed-off-by: Antoine Pelisse <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jens Lindstrom [Tue, 22 Oct 2013 13:36:02 +0000 (15:36 +0200)]
Clear fd after closing to avoid double-close error
In send_pack(), clear the fd passed to pack_objects() by setting
it to -1, since pack_objects() closes the fd (via a call to
run_command()). Likewise, in get_pack(), clear the fd passed to
run_command().
Not doing so risks having git_transport_push(), caller of
send_pack(), closing the fd again, possibly incorrectly closing
some other open file; or similarly with fetch_refs_from_pack(),
indirect caller of get_pack().
Signed-off-by: Jens Lindström <redacted>
Acked-by: Jeff King <redacted>
Acked-by: Duy Nguyen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Sat, 19 Oct 2013 21:06:08 +0000 (23:06 +0200)]
Revert "test-lib: allow prefixing a custom string before "ok N" etc."
Now that
ad0e623 (test-lib: support running tests under valgrind in
parallel, 2013-06-23) has been reverted, this support code has no
users any more. Revert it, too.
This reverts commit
e939e15d241e942662b9f88f6127ab470ab0a0b9.
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Sat, 19 Oct 2013 21:06:07 +0000 (23:06 +0200)]
Revert "test-lib: support running tests under valgrind in parallel"
This reverts commit
ad0e6233320b004f0d686f6887c803e508607bd2.
--valgrind-parallel was broken from the start: during review I made
the whole valgrind setup code conditional on not being a
--valgrind-parallel worker child. But even the children crucially
need $GIT_VALGRIND to be set; it should therefore have been set
outside the conditional.
The fix would be a two-liner, but since the introduction of the
feature, almost four months have passed without anyone noticing that
it is broken. So this feature is not worth the about hundred lines of
test-lib.sh complexity. Revert it.
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stefan Beller [Mon, 21 Oct 2013 19:36:06 +0000 (21:36 +0200)]
git-svn docs: Use tabs consistently within the ascii doc
While I can understand 4 or 7 white spaces are fancy, we'd rather want
to use tabs throughout the whole document.
Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brian Gernhardt [Mon, 21 Oct 2013 17:54:12 +0000 (13:54 -0400)]
t5570: Update for clone-progress-to-stderr branch
git clone now reports its progress to standard error, which throws off
t5570. Using test_i18ngrep instead of test_cmp allows the test to be
more flexible by only looking for the expected error and ignoring any
other output from the program.
Signed-off-by: Brian Gernhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 22 Oct 2013 18:38:42 +0000 (11:38 -0700)]
Merge branch 'jk/clone-progress-to-stderr' into jc/upload-pack-send-symref
* jk/clone-progress-to-stderr:
clone: always set transport options
clone: treat "checking connectivity" like other progress
clone: send diagnostic messages to stderr
Brian Gernhardt [Mon, 21 Oct 2013 17:54:11 +0000 (13:54 -0400)]
t5570: Update for symref capability
git-daemon now uses the symref capability to send the correct HEAD
reference, so the test for that in t5570 now passes.
Signed-off-by: Brian Gernhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Sun, 20 Oct 2013 16:57:41 +0000 (18:57 +0200)]
Documentation: revamp gitk(1)
The gitk manpage suffers from a bit of neglect: there have been only
minor changes, and no changes to the set of options documented, since
a2df1fb (Documentation: New GUI configuration and command-line
options., 2008-11-13). In the meantime, the set of rev-list options
has been expanded several times by options that are useful in gitk,
e.g., --ancestry-path and the optional globbing for --branches, --tags
and --remotes.
Restructure and expand the manpage. List more options that the author
perceives as useful, while remaining somewhat terse. Ideally the user
should not have to look up any of the references, but we dispense with
precise explanations in some places and refer to git-log(1) instead.
Note that the options that have an easy GUI equivalent (e.g.,
--word-diff, -S, --grep) are deliberately not listed even in the cases
where they simply fill in the GUI fields.
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stefan Beller [Fri, 18 Oct 2013 23:25:22 +0000 (01:25 +0200)]
Reword repack documentation to no longer state it's a script
This updates the documentation regarding the changes introduced
by
a1bbc6c01 (2013-09-15, repack: rewrite the shell script in C).
Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nguyễn Thái Ngọc Duy [Sat, 19 Oct 2013 02:41:24 +0000 (09:41 +0700)]
Fix calling parse_pathspec with no paths nor PATHSPEC_PREFER_* flags
When parse_pathspec() is called with no paths, the behavior could be
either return no paths, or return one path that is cwd. Some commands
do the former, some the latter. parse_pathspec() itself does not make
either the default and requires the caller to specify either flag if
it may run into this situation.
I've grep'd through all parse_pathspec() call sites. Some pass
neither, but those are guaranteed never pass empty path to
parse_pathspec(). There are two call sites that may pass empty path
and are fixed with this patch.
[jc: added a test from Antoine's bug report]
Reported-by: Antoine Pelisse <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 18 Oct 2013 20:53:05 +0000 (13:53 -0700)]
Update draft release notes to 1.8.5
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 18 Oct 2013 20:53:48 +0000 (13:53 -0700)]
Merge branch 'maint'
* maint:
git-merge: document the -S option
Junio C Hamano [Fri, 18 Oct 2013 20:50:12 +0000 (13:50 -0700)]
Merge branch 'jc/reflog-doc'
Document rules to use GIT_REFLOG_ACTION variable in the scripted
Porcelain. git-rebase--interactive locally violates them, but it
is a leaf user that does not call out to or dot-source other
scripts, so it does not urgently need to be fixed.
* jc/reflog-doc:
setup_reflog_action: document the rules for using GIT_REFLOG_ACTION
Junio C Hamano [Fri, 18 Oct 2013 20:49:56 +0000 (13:49 -0700)]
Merge branch 'sb/repack-in-c'
Rewrite "git repack" in C.
* sb/repack-in-c:
repack: improve warnings about failure of renaming and removing files
repack: retain the return value of pack-objects
repack: rewrite the shell script in C
Junio C Hamano [Fri, 18 Oct 2013 20:49:51 +0000 (13:49 -0700)]
Merge branch 'jk/clone-progress-to-stderr'
Some progress and diagnostic messages from "git clone" were
incorrectly sent to the standard output stream, not to the standard
error stream.
* jk/clone-progress-to-stderr:
clone: always set transport options
clone: treat "checking connectivity" like other progress
clone: send diagnostic messages to stderr
Junio C Hamano [Fri, 18 Oct 2013 20:49:00 +0000 (13:49 -0700)]
Merge git://github.com/git-l10n/git-po
* git://github.com/git-l10n/git-po:
l10n: fr.po: 2135/2135 messages translated
Matthieu Moy [Fri, 18 Oct 2013 09:25:58 +0000 (11:25 +0200)]
checkout: proper error message on 'git checkout foo bar --'
The previous code was detecting the presence of "--" by looking only at
argument 1. As a result, "git checkout foo bar --" was interpreted as an
ambiguous file/revision list, and errored out with:
error: pathspec 'foo' did not match any file(s) known to git.
error: pathspec 'bar' did not match any file(s) known to git.
error: pathspec '--' did not match any file(s) known to git.
This patch fixes it by walking through the argument list to find the
"--", and now complains about the number of references given.
Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Matthieu Moy [Fri, 18 Oct 2013 09:25:57 +0000 (11:25 +0200)]
checkout: allow dwim for branch creation for "git checkout $branch --"
The "--" notation disambiguates files and branches, but as a side-effect
of the previous implementation, also disabled the branch auto-creation
when $branch does not exist.
A possible scenario is then:
git checkout $branch
=> fails if $branch is both a ref and a file, and suggests --
git checkout $branch --
=> refuses to create the $branch
This patch allows the second form to create $branch, and since the -- is
provided, it does not look for file named $branch.
Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Hemmo Nieminen [Wed, 16 Oct 2013 08:28:50 +0000 (11:28 +0300)]
graph: fix coloring around octopus merges
When drawing the graph of an octopus merge, we draw a horizontal line
from parents 3 and above into the asterisk representing the commit. The
sections of this line should be colored to match the graph lines coming
in from above.
However, if the commit is not in the left-most column we do not take
into account the columns to the left of the commit when calculating
these colors. Fix this by adding the appropriate offset to the column
index used for calculating the color.
Signed-off-by: Hemmo Nieminen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nicolas Vigier [Mon, 14 Oct 2013 23:41:05 +0000 (01:41 +0200)]
git-merge: document the -S option
The option to gpg sign a merge commit is available but was not
documented. Use wording from the git-commit(1) manpage.
Signed-off-by: Nicolas Vigier <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Wed, 16 Oct 2013 23:11:46 +0000 (16:11 -0700)]
gc: remove gc.pid file at end of execution
This file isn't really harmful, but isn't useful either, and can create
minor annoyance for the user:
* It's confusing, as the presence of a *.pid file often implies that a
process is currently running. A user running "ls .git/" and finding
this file may incorrectly guess that a "git gc" is currently running.
* Leaving this file means that a "git gc" in an already gc-ed repo is
no-longer a no-op. A user running "git gc" in a set of repositories,
and then synchronizing this set (e.g. rsync -av, unison, ...) will see
all the gc.pid files as changed, which creates useless noise.
This patch unlinks the file after the garbage collection is done, so that
gc.pid is actually present only during execution.
Future versions of Git may want to use the information left in the gc.pid
file (e.g. for policies like "don't attempt to run a gc if one has
already been ran less than X hours ago"). If so, this patch can safely be
reverted. For now, let's not bother the users.
Explained-by: Matthieu Moy <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Improved-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jean-Noel Avila [Wed, 21 Aug 2013 19:49:43 +0000 (21:49 +0200)]
l10n: fr.po: 2135/2135 messages translated
Signed-off-by: Sebastien Helleu <redacted>
Signed-off-by: Jean-Noel Avila <redacted>
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