OSDN Git Service
Junio C Hamano [Wed, 1 Apr 2015 06:15:45 +0000 (23:15 -0700)]
push-to-deploy: allow pushing into an unborn branch and updating it
Setting receive.denycurrentbranch to updateinstead and pushing into
the current branch, when the working tree and the index is truly
clean, is supposed to reset the working tree and the index to match
the tree of the pushed commit. This did not work when pushing into
an unborn branch.
The code that drives push-to-checkout hook needs no change, as the
interface is defined so that hook can decide what to do when the
push is coming to an unborn branch and take an appropriate action
since the beginning.
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 1 Dec 2014 23:29:54 +0000 (15:29 -0800)]
receive-pack: support push-to-checkout hook
When receive.denyCurrentBranch is set to updateInstead, a push that
tries to update the branch that is currently checked out is accepted
only when the index and the working tree exactly matches the
currently checked out commit, in which case the index and the
working tree are updated to match the pushed commit. Otherwise the
push is refused.
This hook can be used to customize this "push-to-deploy" logic. The
hook receives the commit with which the tip of the current branch is
going to be updated, and can decide what kind of local changes are
acceptable and how to update the index and the working tree to match
the updated tip of the current branch.
For example, the hook can simply run `git read-tree -u -m HEAD "$1"`
in order to emulate 'git fetch' that is run in the reverse direction
with `git push`, as the two-tree form of `read-tree -u -m` is
essentially the same as `git checkout` that switches branches while
keeping the local changes in the working tree that do not interfere
with the difference between the branches.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 1 Dec 2014 21:57:28 +0000 (13:57 -0800)]
receive-pack: refactor updateInstead codepath
Keep the "there is nothing to update in a bare repository", "when
the check and update process runs, here are the GIT_DIR and
GIT_WORK_TREE" logic, which will be common regardless of how the
decision to update and the actual update are done, in the original
update_worktree() function, and split out the "working tree and
the index must match the original HEAD exactly" and "use two-way
read-tree to update the working tree" into a new push_to_deploy()
helper function. This will allow customizing the logic more cleanly
and easily.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 1 Dec 2014 01:54:30 +0000 (17:54 -0800)]
t5516: more tests for receive.denyCurrentBranch=updateInstead
The previous one tests only the case where a path to be updated by
the push-to-deploy has an incompatible change in the target's
working tree that has already been added to the index, but the
feature itself wants to require the working tree to be a lot cleaner
than what is tested. Add a handful more tests to protect the
feature from future changes that mistakenly (from the viewpoint of
the inventor of the feature) loosens the cleanliness requirement,
namely:
- A change only to the working tree but not to the index is still a
change to be protected;
- An untracked file in the working tree that would be overwritten
by a push-to-deploy needs to be protected;
- A change that happens to make a file identical to what is being
pushed is still a change to be protected (i.e. the feature's
cleanliness requirement is more strict than that of checkout).
Also, test that a stat-only change to the working tree is not a
reason to reject a push-to-deploy.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 26 Nov 2014 22:44:16 +0000 (23:44 +0100)]
receive-pack: add another option for receive.denyCurrentBranch
When synchronizing between working directories, it can be handy to update
the current branch via 'push' rather than 'pull', e.g. when pushing a fix
from inside a VM, or when pushing a fix made on a user's machine (where
the developer is not at liberty to install an ssh daemon let alone know
the user's password).
The common workaround – pushing into a temporary branch and then merging
on the other machine – is no longer necessary with this patch.
The new option is:
'updateInstead':
Update the working tree accordingly, but refuse to do so if there
are any uncommitted changes.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 7 Nov 2014 20:01:01 +0000 (12:01 -0800)]
Git 2.2.0-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 6 Nov 2014 18:52:51 +0000 (10:52 -0800)]
Merge branch 'maint'
* maint:
docs/credential-store: s/--store/--file/
Junio C Hamano [Thu, 6 Nov 2014 18:52:40 +0000 (10:52 -0800)]
Merge branch 'nd/gitignore-trailing-whitespace'
Documentation update.
* nd/gitignore-trailing-whitespace:
gitignore.txt: fix spelling of "backslash"
Junio C Hamano [Thu, 6 Nov 2014 18:52:36 +0000 (10:52 -0800)]
Merge branch 'tm/line-log-first-parent'
"git log --first-parent -L..." used to crash.
* tm/line-log-first-parent:
line-log: fix crash when --first-parent is used
Junio C Hamano [Thu, 6 Nov 2014 18:52:31 +0000 (10:52 -0800)]
Merge branch 'jk/fetch-reflog-df-conflict'
Corner-case bugfixes for "git fetch" around reflog handling.
* jk/fetch-reflog-df-conflict:
ignore stale directories when checking reflog existence
fetch: load all default config at startup
Junio C Hamano [Thu, 6 Nov 2014 18:52:23 +0000 (10:52 -0800)]
Merge branch 'rs/use-child-process-init-more'
* rs/use-child-process-init-more:
bundle: split out ref writing from bundle_create
bundle: split out a helper function to compute and write prerequisites
bundle: split out a helper function to create pack data
use child_process_init() to initialize struct child_process variables
Junio C Hamano [Thu, 6 Nov 2014 18:51:35 +0000 (10:51 -0800)]
Merge branch 'jk/cache-tree-protect-from-broken-libgit2'
The code to use cache-tree trusted the on-disk data too much
and fell into an infinite loop.
* jk/cache-tree-protect-from-broken-libgit2:
cache-tree: avoid infinite loop on zero-entry tree
Jeff King [Thu, 6 Nov 2014 07:40:32 +0000 (02:40 -0500)]
docs/credential-store: s/--store/--file/
The option name "--store" was used early in development, but
never even made it into an applied patch, let alone a
released version of git. I forgot to update the matching
documentation at the time, though.
Noticed-by: Jesse Hopkins <jesse.hopkins@lmco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ben North [Tue, 4 Nov 2014 22:18:33 +0000 (22:18 +0000)]
gitignore.txt: fix spelling of "backslash"
Signed-off-by: Ben North <ben@redfrontdoor.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Ackermann [Mon, 3 Nov 2014 20:37:07 +0000 (21:37 +0100)]
Documentation: typofixes
In addition to fixing trivial and obvious typos, be careful about
the following points:
- Spell ASCII, URL and CRC in ALL CAPS;
- Spell Linux as Capitalized;
- Do not omit periods in "i.e." and "e.g.".
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tzvetan Mikov [Tue, 4 Nov 2014 20:33:37 +0000 (12:33 -0800)]
line-log: fix crash when --first-parent is used
line-log tries to access all parents of a commit, but only the first
parent has been loaded if "--first-parent" is specified, resulting
in a crash.
Limit the number of parents to one if "--first-parent" is specified.
Reported-by: Eric N. Vander Weele <ericvw@gmail.com>
Signed-off-by: Tzvetan Mikov <tmikov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 4 Nov 2014 13:24:53 +0000 (08:24 -0500)]
ignore stale directories when checking reflog existence
When we update a ref, we have two rules for whether or not
we actually update the reflog:
1. If the reflog already exists, we will always append to
it.
2. If log_all_ref_updates is set, we will create a new
reflog file if necessary.
We do the existence check by trying to open the reflog file,
either with or without O_CREAT (depending on log_all_ref_updates).
If it fails, then we check errno to see what happened.
If we were not using O_CREAT and we got ENOENT, the file
doesn't exist, and we return success (there isn't a reflog
already, and we were not told to make a new one).
If we get EISDIR, then there is likely a stale directory
that needs to be removed (e.g., there used to be "foo/bar",
it was deleted, and the directory "foo" was left. Now we
want to create the ref "foo"). If O_CREAT is set, then we
catch this case, try to remove the directory, and retry our
open. So far so good.
But if we get EISDIR and O_CREAT is not set, then we treat
this as any other error, which is not right. Like ENOENT,
EISDIR is an indication that we do not have a reflog, and we
should silently return success (we were not told to create
it). Instead, the current code reports this as an error, and
we fail to update the ref at all.
Note that this is relatively unlikely to happen, as you
would have to have had reflogs turned on, and then later
turned them off (it could also happen due to a bug in fetch,
but that was fixed in the previous commit). However, it's
quite easy to fix: we just need to treat EISDIR like ENOENT
for the non-O_CREAT case, and silently return (note that
this early return means we can also simplify the O_CREAT
case).
Our new tests cover both cases (O_CREAT and non-O_CREAT).
The first one already worked, of course.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 4 Nov 2014 13:11:19 +0000 (08:11 -0500)]
fetch: load all default config at startup
When we start the git-fetch program, we call git_config to
load all config, but our callback only processes the
fetch.prune option; we do not chain to git_default_config at
all.
This means that we may not load some core configuration
which will have an effect. For instance, we do not load
core.logAllRefUpdates, which impacts whether or not we
create reflogs in a bare repository.
Note that I said "may" above. It gets even more exciting. If
we have to transfer actual objects as part of the fetch,
then we call fetch_pack as part of the same process. That
function loads its own config, which does chain to
git_default_config, impacting global variables which are
used by the rest of fetch. But if the fetch is a pure ref
update (e.g., a new ref which is a copy of an old one), we
skip fetch_pack entirely. So we get inconsistent results
depending on whether or not we have actual objects to
transfer or not!
Let's just load the core config at the start of fetch, so we
know we have it (we may also load it again as part of
fetch_pack, but that's OK; it's designed to be idempotent).
Our tests check both cases (with and without a pack). We
also check similar behavior for push for good measure, but
it already works as expected.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy [Mon, 3 Nov 2014 15:12:00 +0000 (16:12 +0100)]
RelNotes/2.2.0.txt: fix minor typos
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 31 Oct 2014 18:57:23 +0000 (11:57 -0700)]
Git 2.2.0-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 31 Oct 2014 18:50:20 +0000 (11:50 -0700)]
Merge branch 'for-junio' of git://bogomips.org/git-svn
* 'for-junio' of git://bogomips.org/git-svn:
git-svn: use SVN::Ra::get_dir2 when possible
git-svn: add space after "W:" prefix in warning
git-svn: (cleanup) remove editor param passing
git-svn: prepare SVN::Ra config pieces once
Git.pm: add specified name to tempfile template
git-svn: disable _rev_list memoization
git-svn: save a little memory as fetch progresses
git-svn: remove unnecessary DESTROY override
git-svn: reload RA every log-window-size
git-svn.txt: advertise pushurl with dcommit
git-svn: remove mergeinfo rev caching
git-svn: cache only mergeinfo revisions
git-svn: reduce check_cherry_pick cache overhead
git-svn: only look at the root path for svn:mergeinfo
git-svn: only look at the new parts of svn:mergeinfo
Junio C Hamano [Fri, 31 Oct 2014 18:49:53 +0000 (11:49 -0700)]
Merge branch 'jc/push-cert'
* jc/push-cert:
receive-pack: avoid minor leak in case start_async() fails
Junio C Hamano [Fri, 31 Oct 2014 18:49:48 +0000 (11:49 -0700)]
Merge branch 'rs/child-process-init'
* rs/child-process-init:
api-run-command: add missing list item marker
Junio C Hamano [Fri, 31 Oct 2014 18:49:37 +0000 (11:49 -0700)]
Merge branch 'rs/grep-color-words'
Allow painting or not painting (partial) matches in context lines
when showing "grep -C<num>" output in color.
* rs/grep-color-words:
grep: add color.grep.matchcontext and color.grep.matchselected
Eric Wong [Fri, 31 Oct 2014 10:34:03 +0000 (10:34 +0000)]
git-svn: use SVN::Ra::get_dir2 when possible
This avoids the following failure with normal "get_dir" on newer
versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):
Incorrect parameters given: Could not convert '%ld' into a number
get_dir2 also has the potential to be more efficient by requesting
less data.
ref: <
1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>
ref: <
1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Jeff King [Thu, 30 Oct 2014 21:35:24 +0000 (17:35 -0400)]
bundle: split out ref writing from bundle_create
The bundle_create() function has a number of logical steps:
process the input, write the refs, and write the packfile.
Recent commits split the first and third into separate
sub-functions. It's worth splitting the middle step out,
too, if only because it makes the progression of the steps
more obvious.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 30 Oct 2014 18:01:37 +0000 (11:01 -0700)]
bundle: split out a helper function to compute and write prerequisites
The new helper compute_and_write_prerequistes() is ugly, but it
cannot be avoided. Ideally we should avoid a function that computes
and does I/O at the same time, but the prerequisites lines in the
output needs the human readable title only to help the recipient of
the bundle. The code copies them straight from the rev-list output
and immediately discards as no other internal computation needs that
information.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 30 Oct 2014 17:45:41 +0000 (10:45 -0700)]
bundle: split out a helper function to create pack data
The create_bundle() function, while it does one single logical
thing, takes a rather large implementation to do so.
Let's start separating what it does into smaller steps to make it
easier to see what is going on. This is a first step to separate
out the actual pack-data generation, after the earlier part of the
function figures out which part of the history to place in the
bundle.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 29 Oct 2014 17:11:58 +0000 (13:11 -0400)]
cache-tree: avoid infinite loop on zero-entry tree
The loop in cache-tree's update_one iterates over all the
entries in the index. For each one, we find the cache-tree
subtree which represents our path (creating it if
necessary), and then recurse into update_one again. The
return value we get is the number of index entries that
belonged in that subtree. So for example, with entries:
a/one
a/two
b/one
We start by processing the first entry, "a/one". We would
find the subtree for "a" and recurse into update_one. That
would then handle "a/one" and "a/two", and return the value
2. The parent function then skips past the 2 handled
entries, and we continue by processing "b/one".
If the recursed-into update_one ever returns 0, then we make
no forward progress in our loop. We would process "a/one"
over and over, infinitely.
This should not happen normally. Any subtree we create must
have at least one path in it (the one that we are
processing!). However, we may also reuse a cache-tree entry
we found in the on-disk index. For the same reason, this
should also never have zero entries. However, certain buggy
versions of libgit2 could produce such bogus cache-tree
records. The libgit2 bug has since been fixed, but it does
not hurt to protect ourselves against bogus input coming
from the on-disk data structures.
Note that this is not a die("BUG") or assert, because it is
not an internal bug, but rather a corrupted on-disk
structure. It's possible that we could even recover from it
(by throwing out the bogus cache-tree entry), but it is not
worth the effort; the important thing is that we report an
error instead of looping infinitely.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 30 Oct 2014 17:07:33 +0000 (10:07 -0700)]
Merge git://ozlabs.org/~paulus/gitk
* git://ozlabs.org/~paulus/gitk:
gitk: Remove boilerplate for configuration variables
gitk: Show detached HEAD if --all is specified
gitk: Do not depend on Cygwin's "kill" command on Windows
Eric Wong [Thu, 30 Oct 2014 08:31:28 +0000 (08:31 +0000)]
git-svn: add space after "W:" prefix in warning
And minor reformatting while we're in the area.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Wed, 29 Oct 2014 20:10:29 +0000 (20:10 +0000)]
git-svn: (cleanup) remove editor param passing
Neither find_extra_svk_parents or find_extra_svn_parents ever
used the `$ed' parameter.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Max Kirillov [Sun, 14 Sep 2014 20:35:57 +0000 (23:35 +0300)]
gitk: Remove boilerplate for configuration variables
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Max Kirillov [Tue, 9 Sep 2014 07:29:16 +0000 (10:29 +0300)]
gitk: Show detached HEAD if --all is specified
If HEAD is detached, 'gitk --all' does not show it. This is inconvenient
for frontend program, and for example git log does show the detached HEAD.
gitk uses git rev-parse to find a list of branches to show.
Apparently, the command does not include detached HEAD to output if
--all argument is specified. This has been discussed in [1] and stated
as expected behavior. So rev-parse's parameters should be tuned in gitk.
[1] http://thread.gmane.org/gmane.comp.version-control.git/255996
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Sebastian Schuberth [Thu, 23 Oct 2014 19:30:54 +0000 (21:30 +0200)]
gitk: Do not depend on Cygwin's "kill" command on Windows
Windows does not necessarily mean Cygwin, it could also be MSYS. The
latter ships with a version of "kill" that does not understand "-f".
In msysgit this was addressed by shipping Cygwin's version of kill.
Properly fix this by using the stock Windows "taskkill" command instead,
which is available since Windows XP Professional.
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Eric Wong [Wed, 29 Oct 2014 19:55:02 +0000 (19:55 +0000)]
git-svn: prepare SVN::Ra config pieces once
Memoizing these initialization functions saves some memory for
long fetches which require scanning many unwanted revisions
before any wanted revisions happen.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Wed, 29 Oct 2014 19:31:55 +0000 (19:31 +0000)]
Git.pm: add specified name to tempfile template
This should help me track down errors in git-svn more easily:
write .git/Git_XXXXXX: Bad file descriptor
at /usr/lib/perl5/SVN/Ra.pm line 623
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Junio C Hamano [Wed, 29 Oct 2014 17:49:54 +0000 (10:49 -0700)]
Sync with Git 2.1.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 29 Oct 2014 17:48:38 +0000 (10:48 -0700)]
Git 2.1.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 29 Oct 2014 17:35:17 +0000 (10:35 -0700)]
Merge branch 'jk/pack-objects-no-bitmap-when-splitting' into maint
* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs
Junio C Hamano [Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)]
Merge branch 'da/mergetool-meld' into maint
* da/mergetool-meld:
mergetools/meld: make usage of `--output` configurable and more robust
Junio C Hamano [Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)]
Merge branch 'rm/gitweb-start-form' into maint
* rm/gitweb-start-form:
gitweb: use start_form, not startform that was removed in CGI.pm 4.04
Junio C Hamano [Wed, 29 Oct 2014 17:35:10 +0000 (10:35 -0700)]
Merge branch 'bc/asciidoc-pretty-formats-fix' into maint
* bc/asciidoc-pretty-formats-fix:
Documentation: fix misrender of pretty-formats in Asciidoctor
Junio C Hamano [Wed, 29 Oct 2014 17:35:09 +0000 (10:35 -0700)]
Merge branch 'rs/daemon-fixes' into maint
* rs/daemon-fixes:
daemon: remove write-only variable maxfd
daemon: fix error message after bind()
daemon: handle gethostbyname() error
Junio C Hamano [Wed, 29 Oct 2014 17:18:31 +0000 (10:18 -0700)]
Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 29 Oct 2014 17:09:35 +0000 (10:09 -0700)]
Merge branch 'da/difftool'
Allow diff tool backend to stop early by exiting with a non-zero
status.
* da/difftool:
difftool: add support for --trust-exit-code
difftool--helper: exit when reading a prompt answer fails
Junio C Hamano [Wed, 29 Oct 2014 17:09:31 +0000 (10:09 -0700)]
Merge branch 'rb/pack-window-memory-config-doc'
* rb/pack-window-memory-config-doc:
config.txt: pack.windowmemory limit applies per-thread
Junio C Hamano [Wed, 29 Oct 2014 17:08:15 +0000 (10:08 -0700)]
Merge branch 'mg/lib-gpg-ro-safety'
In a tarball extract whose files are all read-only, running GPG
tests would have failed due to unwritable files.
* mg/lib-gpg-ro-safety:
t/lib-gpg: make gpghome files writable
Junio C Hamano [Wed, 29 Oct 2014 17:08:06 +0000 (10:08 -0700)]
Merge branch 'dm/port2zos'
z/OS port
* dm/port2zos:
compat/bswap.h: detect endianness from XL C compiler macros
Makefile: reorder linker flags in the git executable rule
git-compat-util.h: support variadic macros with the XL C compiler
Junio C Hamano [Wed, 29 Oct 2014 17:08:03 +0000 (10:08 -0700)]
Merge branch 'oc/mergetools-beyondcompare'
* oc/mergetools-beyondcompare:
mergetool: rename bc3 to bc
Junio C Hamano [Wed, 29 Oct 2014 17:07:56 +0000 (10:07 -0700)]
Merge branch 'jk/prune-mtime'
Tighten the logic to decide that an unreachable cruft is
sufficiently old by covering corner cases such as an ancient object
becoming reachable and then going unreachable again, in which case
its retention period should be prolonged.
* jk/prune-mtime: (28 commits)
drop add_object_array_with_mode
revision: remove definition of unused 'add_object' function
pack-objects: double-check options before discarding objects
repack: pack objects mentioned by the index
pack-objects: use argv_array
reachable: use revision machinery's --indexed-objects code
rev-list: add --indexed-objects option
rev-list: document --reflog option
t5516: test pushing a tag of an otherwise unreferenced blob
traverse_commit_list: support pending blobs/trees with paths
make add_object_array_with_context interface more sane
write_sha1_file: freshen existing objects
pack-objects: match prune logic for discarding objects
pack-objects: refactor unpack-unreachable expiration check
prune: keep objects reachable from recent objects
sha1_file: add for_each iterators for loose and packed objects
count-objects: use for_each_loose_file_in_objdir
count-objects: do not use xsize_t when counting object size
prune-packed: use for_each_loose_file_in_objdir
reachable: mark index blobs as SEEN
...
Junio C Hamano [Wed, 29 Oct 2014 17:07:39 +0000 (10:07 -0700)]
Merge branch 'bc/asciidoctor'
Add machinery to alternatively use AsciiDoctor to format our
documentation.
* bc/asciidoctor:
Documentation: remove Asciidoctor linkgit macro
Documentation: refactor common operations into variables
Documentation: implement linkgit macro for Asciidoctor
Documentation: move some AsciiDoc parameters into variables
René Scharfe [Tue, 28 Oct 2014 22:09:53 +0000 (23:09 +0100)]
api-run-command: add missing list item marker
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Tue, 28 Oct 2014 20:52:34 +0000 (21:52 +0100)]
use child_process_init() to initialize struct child_process variables
Call child_process_init() instead of zeroing the memory of variables of
type struct child_process by hand before use because the former is both
clearer and shorter.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Tue, 28 Oct 2014 20:27:54 +0000 (21:27 +0100)]
receive-pack: avoid minor leak in case start_async() fails
If the asynchronous start of copy_to_sideband() fails, then any
env_array entries added to struct child_process proc by
prepare_push_cert_sha1() are leaked. Call the latter function only
after start_async() succeeded so that the allocated entries are
cleaned up automatically by start_command() or finish_command().
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Mon, 27 Oct 2014 01:15:42 +0000 (18:15 -0700)]
difftool: add support for --trust-exit-code
Teach difftool to exit when a diff tool returns a non-zero exit
code when either --trust-exit-code is specified or
difftool.trustExitCode is true.
Forward exit codes from invoked diff tools to the caller when
--trust-exit-code is used.
Suggested-by: Adri Farr <14farresa@gmail.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Mon, 27 Oct 2014 18:23:05 +0000 (19:23 +0100)]
grep: add color.grep.matchcontext and color.grep.matchselected
The config option color.grep.match can be used to specify the highlighting
color for matching strings. Add the options matchContext and matchSelected
to allow different colors to be specified for matching strings in the
context vs. in selected lines. This is similar to the ms and mc specifiers
in GNU grep's environment variable GREP_COLORS.
Tests are from Zoltan Klinger's earlier attempt to solve the same
issue in a different way.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Robert de Bath [Fri, 24 Oct 2014 07:43:27 +0000 (08:43 +0100)]
config.txt: pack.windowmemory limit applies per-thread
It took me a long time to notice the rider on the pack.threads
configuration option that it would multiple the memory consumption
by the number of CPUs in the machine. Clarify that the limit
applies per-thread.
Signed-off-by: Robert de Bath <rdebath@tvisiontech.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber [Fri, 24 Oct 2014 15:23:32 +0000 (17:23 +0200)]
t/lib-gpg: make gpghome files writable
t/lib-gpg.sh copies the test environment's gpg home to the trash
directory and makes sure the directoty is writable.
Make sure the copied files are writable, too.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson [Mon, 27 Oct 2014 00:13:43 +0000 (00:13 +0000)]
Documentation: remove Asciidoctor linkgit macro
Asciidoctor provides an extension implementing a backend-independent
macro for dealing with manpage links just like the linkgit macro. As
this is more likely to be up-to-date with future changes in Asciidoctor,
prefer using it over reimplementing in Git.
This reverts commit
773ee47c2b9c691d9758b2bea6cac10e3f0c4e12.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson [Mon, 27 Oct 2014 00:13:42 +0000 (00:13 +0000)]
Documentation: refactor common operations into variables
The Makefile performs several very similar tasks to convert AsciiDoc
files into either HTML or DocBook. Move these items into variables to
reduce the duplication.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Michael [Sun, 26 Oct 2014 17:34:26 +0000 (13:34 -0400)]
compat/bswap.h: detect endianness from XL C compiler macros
There is no /usr/include/endian.h equivalent on z/OS, but the
compiler will define macros to indicate endianness on host and
target hardware. This adds a test for these macros as a last
resort for determining byte order.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Michael [Sun, 26 Oct 2014 17:33:53 +0000 (13:33 -0400)]
Makefile: reorder linker flags in the git executable rule
The XL C compiler can fail due to mixing library path and object
file arguments, for example when linking git while building with
"gmake LDFLAGS=-L$prefix/lib".
Move the ALL_LDFLAGS variable expansion in the git executable rule
to be consistent with all the other linking rules, namely to have
LDFLAGS such as -L$where before the object files *.o being linked
together.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Michael [Sun, 26 Oct 2014 17:33:12 +0000 (13:33 -0400)]
git-compat-util.h: support variadic macros with the XL C compiler
When the XL C compiler is run with an appropriate language level or
suboption, it defines a feature test macro to indicate support for
variadic macros by defining __C99_MACRO_WITH_VA_ARGS C preprocessor
macro.
This was tested on z/OS, but it should also work on AIX according
to IBM documentation.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt [Sun, 26 Oct 2014 08:09:20 +0000 (09:09 +0100)]
difftool--helper: exit when reading a prompt answer fails
An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
not quit it, but is treated as if 'yes' was answered to the prompt and
all following prompts, which is contrary to the user's intent. Fix the
error check.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Wong [Mon, 27 Oct 2014 01:39:39 +0000 (01:39 +0000)]
git-svn: disable _rev_list memoization
This memoization appears unneeded as the check_cherry_pick2 cache is
in front of it does enough.
With this change applied, importing from local svn+ssh and http copies
of the R repo[1] takes only 2:00 (2 hours) on my system and the git-svn
process never uses more than 60MB RSS on my x86-64 GNU/Linux system[2].
This 60M measurement is only for the git-svn Perl process itself and
does not include memory used by git subprocesses accessing large packs
(subprocess memory usage _is_ measured by my time(1) tool).
Before this change, an import took longer (2:20) on svn+ssh:// but
git-svn used around 240MB during the imports. Worse yet, git-svn
ballooned to over 400M when writing out the cache to the filesystem.
I also tried removing memoization for `has_no_changes', too, but a
local copy of the R repository(*) was not close to finishing within
10 hours on my system.
[1] http://svn.r-project.org/R
[2] file:// repos causes libsvn to use more memory internally
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Eric Wong [Sat, 25 Oct 2014 07:56:12 +0000 (07:56 +0000)]
git-svn: save a little memory as fetch progresses
There is no reason to keep entries in the %revs hash after we're
done processing a revision, so allow entries become freed as
processing continues.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Sat, 25 Oct 2014 07:56:11 +0000 (07:56 +0000)]
git-svn: remove unnecessary DESTROY override
This override was probably never necessary, but most likely a no-op
as it does not appear to do anything in SVN::Ra itself.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Fri, 24 Oct 2014 22:53:52 +0000 (22:53 +0000)]
git-svn: reload RA every log-window-size
Despite attempting to use local memory pools everywhere we can,
(including our call to SVN::Ra::do_update and all subsequent reporter
calls), there does not appear to be a way to force the Git::SVN::Fetcher
callbacks to use a pool other than the per-SVN::Ra pool.
Git::SVN::Fetcher ends up using the main RA pool which grows
monotonically in size for the lifetime of the RA object.
Thus the only way to free that memory appears to be to destroy and
recreate the RA connection for at every --log-window-size interval.
This reduces memory usage over the course of fetching 10K revisions
using a test repository created with the script at the end of this
commit message.
As reported by time(1) on my x86-64 system:
before: 54024k
after: 28680k
Unfortunately, there remains some yet-to-be-tracked-down slow memory
growth which would be evident as the `nr' parameter increases in
the repository generation script:
-----------------------------8<------------------------------
set -e
tmp=$(mktemp -d svntestrepo-XXXXXXXX)
svnadmin create "$tmp"
repo=file://"$(cd $tmp && pwd)"
svn co "$repo" "$tmp/wd"
cd "$tmp/wd"
if ! test -f a
then
> a
svn add a
svn commit -m 'A'
fi
nr=10000
while test $nr -gt 0
do
echo $nr > a
svn commit -q -m A
nr=$((nr - 1))
done
echo "repository created in $repo"
-----------------------------8<------------------------------
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Sveinung Kvilhaugsvik [Thu, 9 Oct 2014 22:49:59 +0000 (00:49 +0200)]
git-svn.txt: advertise pushurl with dcommit
Advertise that the svn-remote.<name>.pushurl config key allows specifying
the commit URL for the entire SVN repository in the documentation of the
git svn dcommit command.
Signed-off-by: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Tue, 21 Oct 2014 06:23:22 +0000 (06:23 +0000)]
git-svn: remove mergeinfo rev caching
This should further reduce memory usage from the new mergeinfo
speedups without hurting performance too much, assuming
reasonable latency to the SVN server.
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Suggested-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Mon, 20 Oct 2014 01:02:53 +0000 (01:02 +0000)]
git-svn: cache only mergeinfo revisions
This should reduce excessive memory usage from the new mergeinfo
caches without hurting performance too much, assuming reasonable
latency to the SVN server.
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Suggested-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Sun, 19 Oct 2014 04:08:31 +0000 (04:08 +0000)]
git-svn: reduce check_cherry_pick cache overhead
We do not need to store entire lists of commits, only the
number of incomplete and the first commit for reference.
This reduces the amount of data we need to store in memory
and on disk stores.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Jakob Stoklund Olesen [Thu, 17 Apr 2014 06:54:06 +0000 (23:54 -0700)]
git-svn: only look at the root path for svn:mergeinfo
Subversion can put mergeinfo on any sub-directory to track cherry-picks.
Since cherry-picks are not represented explicitly in git, git-svn should
just ignore it.
Signed-off-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Jakob Stoklund Olesen [Thu, 17 Apr 2014 06:54:05 +0000 (23:54 -0700)]
git-svn: only look at the new parts of svn:mergeinfo
In a Subversion repository where many feature branches are merged into a
trunk, the svn:mergeinfo property can grow very large. This severely
slows down git-svn's make_log_entry() because it is checking all
mergeinfo entries every time the property changes.
In most cases, the additions to svn:mergeinfo since the last commit are
pretty small, and there is nothing to gain by checking merges that were
already checked for the last commit in the branch.
Add a mergeinfo_changes() function which computes the set of interesting
changes to svn:mergeinfo since the last commit. Filter out merged
branches whose ranges haven't changed, and remove a common prefix of
ranges from other merged branches.
This speeds up "git svn fetch" by several orders of magnitude on a large
repository where thousands of feature branches have been merged.
Signed-off-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Junio C Hamano [Fri, 24 Oct 2014 22:02:17 +0000 (15:02 -0700)]
Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 24 Oct 2014 22:01:32 +0000 (15:01 -0700)]
Merge branch 'jc/push-cert'
* jc/push-cert:
push: heed user.signingkey for signed pushes
Junio C Hamano [Fri, 24 Oct 2014 22:00:09 +0000 (15:00 -0700)]
Merge branch 'sb/plug-transport-leak'
Code clean-up.
* sb/plug-transport-leak:
.mailmap: add Stefan Bellers corporate mail address
transport: free leaking head in transport_print_push_status()
Junio C Hamano [Fri, 24 Oct 2014 22:00:05 +0000 (15:00 -0700)]
Merge branch 'nd/dir-prep-exclude-cleanup'
Code clean-up.
* nd/dir-prep-exclude-cleanup:
dir.c: remove the second declaration of "stk" in prep_exclude()
Junio C Hamano [Fri, 24 Oct 2014 21:59:10 +0000 (14:59 -0700)]
Merge branch 'eb/no-pthreads'
Allow us build with NO_PTHREADS=NoThanks compilation option.
* eb/no-pthreads:
Handle atexit list internaly for unthreaded builds
pack-objects: set number of threads before checking and warning
index-pack: fix compilation with NO_PTHREADS
Junio C Hamano [Fri, 24 Oct 2014 21:59:02 +0000 (14:59 -0700)]
Merge branch 'wk/t1304-wo-USER'
* wk/t1304-wo-USER:
t1304: Set LOGNAME even if USER is unset or null
Junio C Hamano [Fri, 24 Oct 2014 21:57:57 +0000 (14:57 -0700)]
Merge branch 'tb/core-filemode-doc'
Doc update.
* tb/core-filemode-doc:
core.filemode may need manual action
Junio C Hamano [Fri, 24 Oct 2014 21:57:53 +0000 (14:57 -0700)]
Merge branch 'rs/run-command-env-array'
Add managed "env" array to child_process to clarify the lifetime
rules.
* rs/run-command-env-array:
use env_array member of struct child_process
run-command: add env_array, an optional argv_array for env
Junio C Hamano [Fri, 24 Oct 2014 21:57:51 +0000 (14:57 -0700)]
Merge branch 'po/doc-status-markup'
Update documentation mark-up.
* po/doc-status-markup:
doc: fix 'git status --help' character quoting
Junio C Hamano [Fri, 24 Oct 2014 21:56:10 +0000 (14:56 -0700)]
Merge branch 'jk/pack-objects-no-bitmap-when-splitting'
Splitting pack-objects output into multiple packs is incompatible
with the use of reachability bitmap.
* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs
Michael J Gruber [Wed, 22 Oct 2014 14:57:49 +0000 (16:57 +0200)]
push: heed user.signingkey for signed pushes
push --signed promises to take user.signingkey as the signing key but
fails to read the config.
Make it do so.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 21 Oct 2014 20:35:44 +0000 (13:35 -0700)]
Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 21 Oct 2014 20:28:50 +0000 (13:28 -0700)]
Merge branch 'js/completion-hide-not-a-repo'
Some internal error messages leaked out of the bash completion when
typing "git cmd <TAB>" and the machinery tried to complete
refnames.
* js/completion-hide-not-a-repo:
completion: silence "fatal: Not a git repository" error
Junio C Hamano [Tue, 21 Oct 2014 20:28:47 +0000 (13:28 -0700)]
Merge branch 'da/mergetool-meld'
Newer versions of 'meld' breaks the auto-detection we use to see if
they are new enough to support the `--output` option.
* da/mergetool-meld:
mergetools/meld: make usage of `--output` configurable and more robust
Junio C Hamano [Tue, 21 Oct 2014 20:28:42 +0000 (13:28 -0700)]
Merge branch 'da/mergetool-temporary-directory'
Allow a temporary directory specified to be used while running "git
mergetool" backend.
* da/mergetool-temporary-directory:
t7610-mergetool: add test cases for mergetool.writeToTemp
mergetool: add an option for writing to a temporary directory
Junio C Hamano [Tue, 21 Oct 2014 20:28:37 +0000 (13:28 -0700)]
Merge branch 'da/mergetool-tool-help'
Allow "git mergetool --help" to run outside a Git repository.
* da/mergetool-tool-help:
difftool: don't assume that default sh is sane
mergetool: don't require a work tree for --tool-help
git-sh-setup: move GIT_DIR initialization into a function
mergetool: use more conservative temporary filenames
test-lib-functions: adjust style to match CodingGuidelines
t7610-mergetool: prefer test_config over git config
Junio C Hamano [Tue, 21 Oct 2014 20:28:19 +0000 (13:28 -0700)]
Merge branch 'da/mergetool-temporary-filename'
Tweak the names of the three throw-away files "git mergetool" comes
up with to feed the merge tool backend, so that a file with a
single dot in its name in the original (e.g. "hello.c") will have
only one dot in these variants (e.g. "hello_BASE_4321.c").
* da/mergetool-temporary-filename:
mergetool: use more conservative temporary filenames
Junio C Hamano [Tue, 21 Oct 2014 20:28:14 +0000 (13:28 -0700)]
Merge branch 'da/mergetool-tests'
The clean-up of this test script was long overdue and is a very
welcome change.
* da/mergetool-tests:
test-lib-functions: adjust style to match CodingGuidelines
t7610-mergetool: use test_config to isolate tests
t7610-mergetool: add missing && and remove commented-out code
t7610-mergetool: use tabs instead of a mix of tabs and spaces
Junio C Hamano [Tue, 21 Oct 2014 20:28:10 +0000 (13:28 -0700)]
Merge branch 'rs/ref-transaction'
The API to update refs have been restructured to allow introducing
a true transactional updates later. We would even allow storing
refs in backends other than the traditional filesystem-based one.
* rs/ref-transaction: (25 commits)
ref_transaction_commit: bail out on failure to remove a ref
lockfile: remove unable_to_lock_error
refs.c: do not permit err == NULL
remote rm/prune: print a message when writing packed-refs fails
for-each-ref: skip and warn about broken ref names
refs.c: allow listing and deleting badly named refs
test: put tests for handling of bad ref names in one place
packed-ref cache: forbid dot-components in refnames
branch -d: simplify by using RESOLVE_REF_READING
branch -d: avoid repeated symref resolution
reflog test: test interaction with detached HEAD
refs.c: change resolve_ref_unsafe reading argument to be a flags field
refs.c: make write_ref_sha1 static
fetch.c: change s_update_ref to use a ref transaction
refs.c: ref_transaction_commit: distinguish name conflicts from other errors
refs.c: pass a list of names to skip to is_refname_available
refs.c: call lock_ref_sha1_basic directly from commit
refs.c: refuse to lock badly named refs in lock_ref_sha1_basic
rename_ref: don't ask read_ref_full where the ref came from
refs.c: pass the ref log message to _create/delete/update instead of _commit
...
Junio C Hamano [Mon, 20 Oct 2014 22:49:36 +0000 (15:49 -0700)]
mergetool: rename bc3 to bc
Beyond Compare version 4 works the same way as version 3, so rename
the existing "bc3" adaptor to just "bc", while keeping "bc3" as a
backward compatible wrapper.
Noticed-by: Olivier Croquette <ocroquette@free.fr>
Helped-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Tue, 21 Oct 2014 11:38:06 +0000 (18:38 +0700)]
dir.c: remove the second declaration of "stk" in prep_exclude()
This "stk" shadows the first declaration at the top. There's currently
no bad effect. But let's avoid it.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Tue, 21 Oct 2014 01:50:45 +0000 (18:50 -0700)]
.mailmap: add Stefan Bellers corporate mail address
Note that despite the private address being first and primary,
Google owns the copyright on this patch as any other patch I'll be
sending signed off by the sbeller@google.com address.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Tue, 21 Oct 2014 01:50:44 +0000 (18:50 -0700)]
transport: free leaking head in transport_print_push_status()
Found by scan.coverity.com (ID:
1248110)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 20 Oct 2014 20:07:32 +0000 (13:07 -0700)]
Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 20 Oct 2014 19:25:30 +0000 (12:25 -0700)]
Merge branch 'cc/interpret-trailers'
A new filter to programatically edit the tail end of the commit log
messages.
* cc/interpret-trailers:
Documentation: add documentation for 'git interpret-trailers'
trailer: add tests for commands in config file
trailer: execute command from 'trailer.<name>.command'
trailer: add tests for "git interpret-trailers"
trailer: add interpret-trailers command
trailer: put all the processing together and print
trailer: parse trailers from file or stdin
trailer: process command line trailer arguments
trailer: read and process config information
trailer: process trailers from input message and arguments
trailer: add data structures and basic functions