Commit graph

38156 commits

Author SHA1 Message Date
Michael Haggerty 4a45b2f347 repack_without_refs(): make the refnames argument a string_list
Most of the callers have string_lists available already, whereas two
of them had to read data out of a string_list into an array of strings
just to call this function. So change repack_without_refs() to take
the list of refnames to omit as a string_list, and change the callers
accordingly.

Suggested-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-25 10:09:58 -08:00
Michael Haggerty 6d6d06c901 prune_remote(): sort delete_refs_list references en masse
Inserting items into a list in sorted order is O(N^2) whereas
appending them unsorted and then sorting the list all at once is
O(N lg N).

string_list_insert() also removes duplicates, and this change loses
that functionality. But the strings in this list, which ultimately
come from a for_each_ref() iteration, cannot contain duplicates.

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>
2014-11-25 10:09:49 -08:00
Michael Haggerty 28d3f214d1 prune_remote(): initialize both delete_refs lists in a single loop
Also free them together at the end of the function.

In a moment, the array version will become redundant. Managing them
together makes later steps more obvious.

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>
2014-11-25 10:09:45 -08:00
Michael Haggerty 16d4fa3d96 prune_remote(): exit early if there are no stale references
Aside from making the logic clearer, this avoids a call to
warn_dangling_symrefs(), which always does a for_each_rawref()
iteration.

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>
2014-11-25 10:07:45 -08:00
Junio C Hamano e69b1ce000 Merge git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
  l10n: Update Catalan translation
2014-11-18 10:27:46 -08:00
Junio C Hamano 0cfd333d0b Merge branch 'jc/doc-commit-only'
* jc/doc-commit-only:
  Documentation/git-commit: clarify that --only/--include records the working tree contents
2014-11-18 10:19:42 -08:00
Junio C Hamano 4d86216f5b Merge branch 'ta/tutorial-modernize'
* ta/tutorial-modernize:
  gittutorial.txt: remove reference to ancient Git version
2014-11-18 10:18:28 -08:00
Junio C Hamano 3f78278beb Merge branch 'da/difftool'
Fix-up to a new feature in 'master'.

* da/difftool:
  difftool: honor --trust-exit-code for builtin tools
2014-11-18 10:16:55 -08:00
Alex Henrie b3e4c47565 l10n: Update Catalan translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2014-11-17 20:22:48 -07:00
Junio C Hamano ea4f93eb99 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
2014-11-17 09:28:23 -08:00
Ralf Thielow d544b2d495 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>
2014-11-15 18:22:05 +01:00
Stefan Beller 744437f8e6 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>
2014-11-15 18:21:58 +01:00
David Aguilar 99474b6340 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>
2014-11-14 13:40:38 -08:00
Junio C Hamano 49e0c5ad0a Git 2.2.0-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-14 13:31:15 -08:00
Ralf Thielow c616d845b5 l10n: de.po: use imperative form for command options
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-11-14 19:21:52 +01:00
Junio C Hamano f5709437d9 Update draft release notes to 2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-12 12:13:39 -08:00
Junio C Hamano 9c70e2c105 Sync with 'maint' 2014-11-12 12:13:25 -08:00
Junio C Hamano 7fa1365c54 Merge branch 'nd/gitignore-trailing-whitespace' into maint
* nd/gitignore-trailing-whitespace:
  gitignore.txt: fix spelling of "backslash"
2014-11-12 12:13:12 -08:00
Junio C Hamano bbebdc1dca 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
2014-11-12 11:59:58 -08:00
Thomas Ackermann 022cf2bf88 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>
2014-11-11 14:46:08 -08:00
Junio C Hamano f6f61cbbad Sync with maint
* maint:
2014-11-11 12:45:48 -08:00
Junio C Hamano caea1a2bb5 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
2014-11-11 10:20:13 -08:00
René Scharfe 6066a7eac4 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>
2014-11-10 14:43:19 -08:00
Junio C Hamano 80b581dd09 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)
2014-11-10 11:59:30 -08:00
Junio C Hamano a4c4708fe6 Sync with maint
* maint:
  Documentation/config.txt: fix minor typo
  config.txt: fix typo
2014-11-10 11:26:18 -08:00
Junio C Hamano bd51886f30 Merge branch 'js/diff-highlight-avoid-sigpipe'
* js/diff-highlight-avoid-sigpipe:
  diff-highlight: exit when a pipe is broken
2014-11-10 11:26:09 -08:00
Thomas Quinot a79c3a1b81 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>
2014-11-10 11:25:26 -08:00
Nicolas Dermine 71069cdfc7 config.txt: fix typo
Signed-off-by: Nicolas Dermine <nicolas.dermine@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-10 10:06:25 -08:00
René Scharfe b226293b44 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>
2014-11-10 10:03:39 -08:00
Jeff King aae828b911 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>
2014-11-10 09:38:53 -08:00
Junio C Hamano 66edfe9ddc Git 2.2.0-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-07 12:01:01 -08:00
Junio C Hamano d956a20a69 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>
2014-11-07 11:57:57 -08:00
Junio C Hamano a1ad2475a7 Merge branch 'maint'
* maint:
  docs/credential-store: s/--store/--file/
2014-11-06 10:52:51 -08:00
Junio C Hamano 32da67bf22 Merge branch 'nd/gitignore-trailing-whitespace'
Documentation update.

* nd/gitignore-trailing-whitespace:
  gitignore.txt: fix spelling of "backslash"
2014-11-06 10:52:40 -08:00
Junio C Hamano 64b9326460 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
2014-11-06 10:52:37 -08:00
Junio C Hamano a1671dd82b 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
2014-11-06 10:52:32 -08:00
Junio C Hamano 6b55f8b546 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
2014-11-06 10:52:23 -08:00
Junio C Hamano e44da1bbb8 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
2014-11-06 10:51:35 -08:00
Jeff King e50cd67ba4 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>
2014-11-06 09:51:08 -08:00
Ben North 03af7cd158 gitignore.txt: fix spelling of "backslash"
Signed-off-by: Ben North <ben@redfrontdoor.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-04 14:44:47 -08:00
John Szakmeister 251e7dad51 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>
2014-11-04 13:18:35 -08:00
Thomas Ackermann f745acb028 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>
2014-11-04 13:14:44 -08:00
Tzvetan Mikov a8787c5c1c 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>
2014-11-04 12:47:35 -08:00
Jeff King 9233887cce 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>
2014-11-04 12:18:44 -08:00
Jeff King 72549dfd5d 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>
2014-11-04 12:13:46 -08:00
Matthieu Moy dd83521629 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>
2014-11-03 11:29:10 -08:00
Alexander Shopov 6c31a5e94a l10n: Updated Bulgarian translation of git (2296t,0f,0u)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2014-11-02 19:11:08 +02:00
Jiang Xin 220c313cc3 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>
2014-11-02 10:59:00 +08:00
Jiang Xin 94dd79e9fe 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
2014-11-02 10:12:29 +08:00
Jiang Xin ac4a73dd25 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)
2014-11-02 10:11:27 +08:00