Stefan Beller [Thu, 8 Jan 2015 03:23:15 +0000 (19:23 -0800)]
receive-pack.c: shorten the execute_commands loop over all commands
Make the main "execute_commands" loop in receive-pack easier to read
by splitting out some steps into helper functions. The new helper
'should_process_cmd' checks if a ref update is unnecessary, whether
due to an error having occurred or for another reason. The helper
'warn_if_skipped_connectivity_check' warns if we have forgotten to
run a connectivity check on a ref which is shallow for the client
which would be a bug.
This will help us to duplicate less code in a later patch when we make
a second copy of the "execute_commands" loop.
No functional change intended.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Fri, 12 Dec 2014 08:57:03 +0000 (09:57 +0100)]
refs.c: let fprintf handle the formatting
Instead of calculating whether to put a plus or minus sign, offload
the responsibilty to the fprintf function.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Fri, 12 Dec 2014 08:57:02 +0000 (09:57 +0100)]
refs.c: don't expose the internal struct ref_lock in the header file
Now the struct ref_lock is used completely internally, so let's
remove it from the header file.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:57:01 +0000 (09:57 +0100)]
lock_any_ref_for_update(): inline function
Inline the function at its one remaining caller (which is within
refs.c) and remove it.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg [Fri, 12 Dec 2014 08:57:00 +0000 (09:57 +0100)]
refs.c: remove unlock_ref/close_ref/commit_ref from the refs api
unlock|close|commit_ref can be made static since there are no more external
callers.
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:59 +0000 (09:56 +0100)]
reflog_expire(): new function in the reference API
Move expire_reflog() into refs.c and rename it to reflog_expire().
Turn the three policy functions into function pointers that are passed
into reflog_expire(). Add function prototypes and documentation to
refs.h.
[jc: squashed in $gmane/261582, drop "extern" in function definition]
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Tweaked-by: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:58 +0000 (09:56 +0100)]
expire_reflog(): treat the policy callback data as opaque
Now that expire_reflog() doesn't actually look in the
expire_reflog_policy_cb data structure, we can make it opaque:
* Change the callers of expire_reflog() to pass it a pointer to an
entire "struct expire_reflog_policy_cb" rather than a pointer to a
"struct cmd_reflog_expire_cb".
* Change expire_reflog() to accept the argument as a "void *" and
simply pass it through to the policy functions.
* Change the policy functions, reflog_expiry_prepare(),
reflog_expiry_cleanup(), and should_expire_reflog_ent(), to accept
"void *cb_data" arguments and cast them back to "struct
expire_reflog_policy_cb" internally.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:57 +0000 (09:56 +0100)]
Move newlog and last_kept_sha1 to "struct expire_reflog_cb"
These members are not needed by the policy functions.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:56 +0000 (09:56 +0100)]
expire_reflog(): move rewrite to flags argument
The policy objects don't care about "--rewrite". So move it to
expire_reflog()'s flags parameter.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:55 +0000 (09:56 +0100)]
expire_reflog(): move verbose to flags argument
The policy objects don't care about "--verbose". So move it to
expire_reflog()'s flags parameter.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:54 +0000 (09:56 +0100)]
expire_reflog(): pass flags through to expire_reflog_ent()
Add a flags field to "struct expire_reflog_cb", and pass the flags
argument through to expire_reflog_ent(). In a moment we will start
using it to pass through flags that expire_reflog_ent() needs.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:53 +0000 (09:56 +0100)]
struct expire_reflog_cb: a new callback data type
Add a new data type, "struct expire_reflog_cb", for holding the data
that expire_reflog() passes to expire_reflog_ent() via
for_each_reflog_ent(). For now it only holds a pointer to a "struct
expire_reflog_policy_cb", which still contains all of the actual data.
In future commits we will move some fields from the latter to the
former.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:52 +0000 (09:56 +0100)]
Rename expire_reflog_cb to expire_reflog_policy_cb
This is the first step towards separating the data needed by the
policy code from the data needed by the reflog expiration machinery.
(In a moment we will add a *new* "struct expire_reflog_cb" for the use
of expire_reflog() itself, then move fields selectively from
expire_reflog_policy_cb to expire_reflog_cb.)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:51 +0000 (09:56 +0100)]
expire_reflog(): move updateref to flags argument
The policy objects don't care about "--updateref". So move it to
expire_reflog()'s flags parameter.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:50 +0000 (09:56 +0100)]
expire_reflog(): move dry_run to flags argument
The policy objects don't care about "--dry-run". So move it to
expire_reflog()'s flags parameter.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:49 +0000 (09:56 +0100)]
expire_reflog(): add a "flags" argument
We want to separate the options relevant to the expiry machinery from
the options affecting the expiration policy. So add a "flags" argument
to expire_reflog() to hold the former.
The argument doesn't yet do anything.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:48 +0000 (09:56 +0100)]
expire_reflog(): extract two policy-related functions
Extract two functions, reflog_expiry_prepare() and
reflog_expiry_cleanup(), from expire_reflog(). This is a further step
towards separating the code for deciding on expiration policy from the
code that manages the physical deletion of reflog entries.
This change requires a couple of local variables from expire_reflog()
to be turned into fields of "struct expire_reflog_cb". More
reorganization of the callback data will follow in later commits.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:47 +0000 (09:56 +0100)]
Extract function should_expire_reflog_ent()
Extract from expire_reflog_ent() a function that is solely responsible
for deciding whether a reflog entry should be expired. By separating
this "business logic" from the mechanics of actually expiring entries,
we are working towards the goal of encapsulating reflog expiry within
the refs API, with policy decided by a callback function passed to it
by its caller.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:46 +0000 (09:56 +0100)]
expire_reflog(): use a lock_file for rewriting the reflog file
We don't actually need the locking functionality, because we already
hold the lock on the reference itself, which is how the reflog file is
locked. But the lock_file code can do some of the bookkeeping for us,
and it is more careful than the old code here was. For example:
* It correctly handles the case that the reflog lock file already
exists for some reason or cannot be opened.
* It correctly cleans up the lockfile if the program dies.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:45 +0000 (09:56 +0100)]
expire_reflog(): return early if the reference has no reflog
There is very little cleanup needed if the reference has no reflog. If
we move the initialization of log_file down a bit, there's even less.
So instead of jumping to the cleanup code at the end of the function,
just do the cleanup and return inline.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:44 +0000 (09:56 +0100)]
expire_reflog(): rename "ref" parameter to "refname"
This is our usual convention.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Fri, 12 Dec 2014 08:56:43 +0000 (09:56 +0100)]
expire_reflog(): it's not an each_ref_fn anymore
Prior to v1.5.4~14, expire_reflog() had to be an each_ref_fn because
it was passed to for_each_reflog(). Since then, there has been no
reason for it to implement the each_ref_fn interface. So...
* Remove the "unused" parameter (which took the place of "flags", but
was really unused).
* Declare the last parameter to be (struct cmd_reflog_expire_cb *)
rather than (void *).
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg [Fri, 12 Dec 2014 08:56:42 +0000 (09:56 +0100)]
refs.c: add a function to append a reflog entry to a fd
Break out the code to create the string and writing it to the file
descriptor from log_ref_write and add it into a dedicated function
log_ref_write_fd. It is a nice unit of work.
For now this is only used from log_ref_write, but in the future it
might have other callers.
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg [Thu, 4 Dec 2014 23:08:14 +0000 (00:08 +0100)]
refs.c: make ref_transaction_delete a wrapper for ref_transaction_update
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg [Thu, 4 Dec 2014 23:08:13 +0000 (00:08 +0100)]
refs.c: make ref_transaction_create a wrapper for ref_transaction_update
The ref_transaction_update function can already be used to create refs by
passing null_sha1 as the old_sha1 parameter. Simplify by replacing
transaction_create with a thin wrapper.
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 26 Nov 2014 21:18:34 +0000 (13:18 -0800)]
Git 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Marc Branchaud [Fri, 21 Nov 2014 23:10:04 +0000 (18:10 -0500)]
RelNotes: spelling & grammar tweaks
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 21 Nov 2014 20:10:56 +0000 (12:10 -0800)]
Git 2.2.0-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Thu, 20 Nov 2014 08:12:34 +0000 (16:12 +0800)]
l10n: remove a superfluous translation for push.c
Ralf reported that '--recurse-submodules' option in push.c should not be
translated [1]. Before his commit is merged, remove superfluous
translations for push.c.
[1] http://www.spinics.net/lists/git/msg241964.html
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Ralf Thielow [Thu, 20 Nov 2014 06:15:15 +0000 (07:15 +0100)]
l10n: de.po: translate 2 messages
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Ralf Thielow [Tue, 18 Nov 2014 18:06:51 +0000 (19:06 +0100)]
l10n: de.po: translate 2 new messages
Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Jiang Xin [Thu, 20 Nov 2014 02:53:48 +0000 (10:53 +0800)]
l10n: batch updates for one trivial change
In order to catch up with the release of Git 2.2.0 final, make a batch
l10n update for the new l10n change brought by commit
d52adf1 (trailer:
display a trailer without its trailing newline).
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Thu, 20 Nov 2014 02:03:10 +0000 (10:03 +0800)]
l10n: git.pot: v2.2.0 round 2 (1 updated)
Generate po/git.pot from
v2.2.0-rc2-23-gca0107e for git v2.2.0 l10n
round 2.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Junio C Hamano [Wed, 19 Nov 2014 21:48:01 +0000 (13:48 -0800)]
Merge branch 'sv/submitting-final-patch'
* sv/submitting-final-patch:
SubmittingPatches: final submission is To: maintainer and CC: list
Junio C Hamano [Wed, 19 Nov 2014 21:47:59 +0000 (13:47 -0800)]
Merge branch 'sn/tutorial-status-output-example'
* sn/tutorial-status-output-example:
gittutorial: fix output of 'git status'
Junio C Hamano [Wed, 19 Nov 2014 21:47:55 +0000 (13:47 -0800)]
Merge branch 'mh/doc-remote-helper-xref'
* mh/doc-remote-helper-xref:
doc: add some crossrefs between manual pages
Junio C Hamano [Wed, 19 Nov 2014 21:47:53 +0000 (13:47 -0800)]
Merge branch 'tb/no-relative-file-url'
* tb/no-relative-file-url:
t5705: the file:// URL should be absolute
Junio C Hamano [Wed, 19 Nov 2014 21:47:49 +0000 (13:47 -0800)]
Merge branch 'cc/interpret-trailers'
Small fixes to a new experimental command already in 'master'.
* cc/interpret-trailers:
trailer: display a trailer without its trailing newline
trailer: ignore comment lines inside the trailers
Junio C Hamano [Tue, 18 Nov 2014 18:27:46 +0000 (10:27 -0800)]
Merge git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
l10n: Update Catalan translation
Junio C Hamano [Tue, 18 Nov 2014 18:19:38 +0000 (10:19 -0800)]
Merge branch 'jc/doc-commit-only'
* jc/doc-commit-only:
Documentation/git-commit: clarify that --only/--include records the working tree contents
Junio C Hamano [Tue, 18 Nov 2014 18:18:28 +0000 (10:18 -0800)]
Merge branch 'ta/tutorial-modernize'
* ta/tutorial-modernize:
gittutorial.txt: remove reference to ancient Git version
Junio C Hamano [Tue, 18 Nov 2014 18:16:54 +0000 (10:16 -0800)]
Merge branch 'da/difftool'
Fix-up to a new feature in 'master'.
* da/difftool:
difftool: honor --trust-exit-code for builtin tools
Alex Henrie [Tue, 18 Nov 2014 03:22:48 +0000 (20:22 -0700)]
l10n: Update Catalan translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Junio C Hamano [Mon, 17 Nov 2014 17:28:23 +0000 (09:28 -0800)]
Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 62 new messages
l10n: de.po: Fixup one translation
l10n: de.po: use imperative form for command options
Ralf Thielow [Thu, 30 Oct 2014 08:00:47 +0000 (09:00 +0100)]
l10n: de.po: translate 62 new messages
Translate 62 new messages came from git.pot update in
16742b0
(l10n: git.pot: proposed updates for v2.2.0 (+62)).
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Stefan Beller [Tue, 23 Sep 2014 12:54:46 +0000 (14:54 +0200)]
l10n: de.po: Fixup one translation
English grammar with German words doesn't make it a German translation. ;)
Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
David Aguilar [Fri, 14 Nov 2014 21:33:55 +0000 (13:33 -0800)]
difftool: honor --trust-exit-code for builtin tools
run_merge_tool() was not setting $status, which prevented the
exit code for builtin tools from being forwarded to the caller.
Capture the exit status and add a test to guarantee the behavior.
Reported-by: Adria Farres <14farresa@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 14 Nov 2014 21:31:15 +0000 (13:31 -0800)]
Git 2.2.0-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ralf Thielow [Fri, 19 Sep 2014 16:38:13 +0000 (18:38 +0200)]
l10n: de.po: use imperative form for command options
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Stefan Naewe [Thu, 13 Nov 2014 10:40:07 +0000 (10:40 +0000)]
gittutorial: fix output of 'git status'
'git status' doesn't output leading '#'s these days.
Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen [Thu, 13 Nov 2014 07:36:07 +0000 (08:36 +0100)]
t5705: the file:// URL should be absolute
The test misused a URL "file://." to mean "relative to here",
which we no longer accept.
In a file:// URL, typically there is no host, and RFC1738 says that
file:///<path> should be used.
Update t5705 to use a working URL.
Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Slavomir Vlcek [Wed, 12 Nov 2014 23:18:39 +0000 (00:18 +0100)]
SubmittingPatches: final submission is To: maintainer and CC: list
In an earlier part there is:
"re-send it with "To:" set to the maintainer [*1*] and "cc:" the list [*2*]"
for the final submission, but later we see
"Send it to the list and cc the maintainer."
Fix the later one to match the previous.
Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 12 Nov 2014 20:12:50 +0000 (12:12 -0800)]
Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 12 Nov 2014 20:13:25 +0000 (12:13 -0800)]
Sync with 'maint'
Junio C Hamano [Wed, 12 Nov 2014 20:13:11 +0000 (12:13 -0800)]
Merge branch 'nd/gitignore-trailing-whitespace' into maint
* nd/gitignore-trailing-whitespace:
gitignore.txt: fix spelling of "backslash"
Junio C Hamano [Wed, 12 Nov 2014 19:59:58 +0000 (11:59 -0800)]
Merge branch 'jk/fetch-reflog-df-conflict'
Fix-up a test for portability.
* jk/fetch-reflog-df-conflict:
t1410: fix breakage on case-insensitive filesystems
Max Horn [Tue, 11 Nov 2014 20:17:07 +0000 (21:17 +0100)]
doc: add some crossrefs between manual pages
In particular, git-fast-import and -export link to each
other, and gitremote-helpers links to existing remote
helpers, and vice versa. Also link to fast-import from the
remote helper spec, as this is relevant for remote helpers
using the fast-import format.
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Ackermann [Tue, 11 Nov 2014 19:13:36 +0000 (20:13 +0100)]
gittutorial.txt: remove reference to ancient Git version
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 11 Nov 2014 20:45:48 +0000 (12:45 -0800)]
Sync with maint
* maint:
Junio C Hamano [Tue, 11 Nov 2014 18:20:13 +0000 (10:20 -0800)]
Merge branch 'rs/clean-menu-item-defn' into maint
* rs/clean-menu-item-defn:
clean: use f(void) instead of f() to declare a pointer to a function without arguments
René Scharfe [Mon, 10 Nov 2014 21:17:00 +0000 (22:17 +0100)]
run-command: use void to declare that functions take no parameters
Explicitly declare that git_atexit_dispatch() and git_atexit_clear()
take no parameters instead of leaving their parameter list empty and
thus unspecified.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 10 Nov 2014 19:59:30 +0000 (11:59 -0800)]
Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
l10n: Updated Bulgarian translation of git (2296t,0f,0u)
l10n: zh_CN: translations for git v2.2.0-rc0
l10n: sv.po: Update Swedish translation (2296t0f0u)
l10n: fr.po (2296t) update for version 2.2.0
l10n: vi.po: Update new message strings
l10n: git.pot: v2.2.0 round 1 (62 new, 23 removed)
Junio C Hamano [Mon, 10 Nov 2014 19:26:18 +0000 (11:26 -0800)]
Sync with maint
* maint:
Documentation/config.txt: fix minor typo
config.txt: fix typo
Junio C Hamano [Mon, 10 Nov 2014 19:26:09 +0000 (11:26 -0800)]
Merge branch 'js/diff-highlight-avoid-sigpipe'
* js/diff-highlight-avoid-sigpipe:
diff-highlight: exit when a pipe is broken
Thomas Quinot [Sat, 8 Nov 2014 10:45:39 +0000 (11:45 +0100)]
Documentation/config.txt: fix minor typo
Add a missing article at the beginning of a sentence, and rephrase
slightly.
Signed-off-by: Thomas Quinot <thomas@quinot.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nicolas Dermine [Sun, 9 Nov 2014 16:19:33 +0000 (17:19 +0100)]
config.txt: fix typo
Signed-off-by: Nicolas Dermine <nicolas.dermine@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sun, 9 Nov 2014 13:49:58 +0000 (14:49 +0100)]
trailer: use CHILD_PROCESS_INIT in apply_command()
Initialize the struct child_process variable cp at declaration time.
This is shorter, saves a function call and prevents using the variable
before initialization by mistake.
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder [Sun, 9 Nov 2014 09:23:40 +0000 (10:23 +0100)]
trailer: display a trailer without its trailing newline
Trailers passed to the parse_trailer() function often have
a trailing newline. When erroring out, we should display
the invalid trailer properly, that means without any
trailing newline.
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder [Sun, 9 Nov 2014 09:23:39 +0000 (10:23 +0100)]
trailer: ignore comment lines inside the trailers
Otherwise trailers that are commented out might be
processed. We would also error out if the comment line
char is also a separator.
This means that comments inside a trailer block will
disappear, but that was already the case anyway.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Sun, 9 Nov 2014 01:59:18 +0000 (20:59 -0500)]
t1410: fix breakage on case-insensitive filesystems
Two tests recently added to t1410 create branches "a" and
"a/b" to test d/f conflicts on reflogs. Earlier, unrelated
tests in that script create the path "A/B" in the working
tree. There's no conflict on a case-sensitive filesystem,
but on a case-insensitive one, "git log" will complain that
"a/b" is both a revision and a working tree path.
We could fix this by using a "--" to disambiguate, but we
are probably better off using names that are less confusing
to make it more clear that they are unrelated to the working
tree files. This patch turns "a/b" into "one/two".
Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
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 [Fri, 7 Nov 2014 19:55:40 +0000 (11:55 -0800)]
Documentation/git-commit: clarify that --only/--include records the working tree contents
With the original phrasing, it is possible to misunderstand as if
the contents in the index for only the specified paths are made into
the new commit.
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>
John Szakmeister [Tue, 4 Nov 2014 20:01:12 +0000 (15:01 -0500)]
diff-highlight: exit when a pipe is broken
While using diff-highlight with other tools, I have discovered that Python
ignores SIGPIPE by default. Unfortunately, this also means that tools
attempting to launch a pager under Python--and don't realize this is
happening--means that the subprocess inherits this setting. In this case, it
means diff-highlight will be launched with SIGPIPE being ignored. Let's work
with those broken scripts by restoring the default SIGPIPE handler.
Signed-off-by: John Szakmeister <john@szakmeister.net>
Acked-by: Jeff King <peff@peff.net>
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>
Alexander Shopov [Fri, 17 Oct 2014 19:39:45 +0000 (22:39 +0300)]
l10n: Updated Bulgarian translation of git (2296t,0f,0u)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Jiang Xin [Wed, 8 Oct 2014 02:55:14 +0000 (10:55 +0800)]
l10n: zh_CN: translations for git v2.2.0-rc0
Translate 62 new messages (2296t0f0u) for git v2.2.0-rc0. Also changed
the translation of bare (repository).
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Sun, 2 Nov 2014 02:12:29 +0000 (10:12 +0800)]
Merge branch 'fr_2.2.0' of git://github.com/jnavila/git
* 'fr_2.2.0' of git://github.com/jnavila/git:
l10n: fr.po (2296t) update for version 2.2.0
Jiang Xin [Sun, 2 Nov 2014 02:11:27 +0000 (10:11 +0800)]
Merge branch 'master' of git://github.com/nafmo/git-l10n-sv
* 'master' of git://github.com/nafmo/git-l10n-sv:
l10n: sv.po: Update Swedish translation (2296t0f0u)
Peter Krefting [Sat, 1 Nov 2014 19:17:37 +0000 (20:17 +0100)]
l10n: sv.po: Update Swedish translation (2296t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Jean-Noel Avila [Sat, 1 Nov 2014 15:29:19 +0000 (16:29 +0100)]
l10n: fr.po (2296t) update for version 2.2.0
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Grégoire Paris <gparis@universcine.com>
Tran Ngoc Quan [Sat, 1 Nov 2014 02:07:24 +0000 (09:07 +0700)]
l10n: vi.po: Update new message strings
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
Jiang Xin [Fri, 31 Oct 2014 23:47:46 +0000 (07:47 +0800)]
l10n: git.pot: v2.2.0 round 1 (62 new, 23 removed)
Generate po/git.pot from v2.2.0-rc0 for git v2.2.0 l10n round 1.
Signed-off-by: Jiang Xin <worldhello.net@gmail.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>