Commit Graph

71902 Commits

Author SHA1 Message Date
Johannes Schindelin
eaaeff1531 gettext: handle GIT_TEXTDOMAINDIR relative to $(prefix)
On Windows, there is no single root directory. And what Git thinks is a
root directory is not a root directory at all: everything is relative to
the location where Git is installed.

To handle this situation better, let's just allow for GIT_TEXTDOMAINDIR
to be a path relative to the (runtime) prefix.

To that end, we have to switch the order in which common-main handles
argv0 and sets up gettext: in order to have access to the runtime
prefix, we need it to be inferred from argv0 already.

This patch also prepares for GIT_LOCALE_PATH to be relative to prefix,
which is the even more important fix.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-05-09 22:46:39 +02:00
Johannes Schindelin
2cb4c91b59 Start the merging-rebase to v2.13.0-rc2
This commit starts the rebase of b2185ebf1a to 4ca9806062

With this merging rebase, we prepare for the upcoming v2.13.0 release,
using the opportunity to update the rebase-i-extra and the coverity
patch series to their newest versions, as well as squashing the "clean
PDBs with MSVC=1" patch into the original patch teaching `make clean` to
remove the .pdb files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-05-09 22:36:52 +02:00
Johannes Schindelin
d4696aab49 fixup! mingw: ensure getcwd() reports the correct case
The return value of GetCurrentDirectoryW() upon errors is actually 0, not
negative (it cannot be negative, as DWORD is an *unsigned* data type).

Also, when converting from _wgetcwd(), I forgot to add errno explicitly...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-05-05 22:23:19 +02:00
Junio C Hamano
4fa66c85f1 Git 2.13-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.13.0-rc2
2017-05-04 16:27:19 +09:00
Junio C Hamano
7c7478f45a Merge branch 'rg/a-the-typo'
Typofix.

* rg/a-the-typo:
  fix minor typos
2017-05-04 16:26:47 +09:00
Junio C Hamano
c8ddd2aa11 Merge branch 'sr/hooks-cwd-doc'
* sr/hooks-cwd-doc:
  githooks.txt: clarify push hooks are always executed in $GIT_DIR
2017-05-04 16:26:46 +09:00
Junio C Hamano
9f3e2fe9f4 Merge branch 'rg/doc-submittingpatches-wordfix'
* rg/doc-submittingpatches-wordfix:
  doc: update SubmittingPatches
2017-05-04 16:26:46 +09:00
Junio C Hamano
741eaf7333 Merge branch 'rg/doc-pull-typofix'
* rg/doc-pull-typofix:
  doc: git-pull.txt use US spelling, fix minor typo
2017-05-04 16:26:45 +09:00
Junio C Hamano
fa675ebd99 Merge branch 'ja/i18n-cleanup'
* ja/i18n-cleanup:
  i18n: read-cache: typofix
  i18n: remove i18n from tag reflog message
2017-05-04 16:26:44 +09:00
Johannes Schindelin
c9743bcefb fixup! name-hash: add perf test for lazy_init_name_hash 2017-05-02 11:56:21 +02:00
Junio C Hamano
d2bbb7c2bc Merging a handful of topics before -rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-30 22:16:18 -07:00
Junio C Hamano
0998b648d6 Merge branch 'sh/rebase-i-reread-todo-after-exec'
"git rebase -i" failed to re-read the todo list file when the
command specified with the `exec` instruction updated it.

* sh/rebase-i-reread-todo-after-exec:
  rebase -i: reread the todo list if `exec` touched it
2017-05-01 14:14:44 +09:00
Junio C Hamano
3c0a7b9d6b Merge branch 'ls/travis-stricter-linux32-builds'
32-bit Linux build on Travis CI uses stricter compilation options.

* ls/travis-stricter-linux32-builds:
  travis-ci: set DEVELOPER knob for Linux32 build
2017-05-01 14:14:44 +09:00
Junio C Hamano
373e4b091d Merge branch 'ls/travis-win-fix-status'
Relaying status from Windows build by Travis CI was done with an
unsafe invocation of printf.

* ls/travis-win-fix-status:
  travis-ci: printf $STATUS as string
2017-05-01 14:14:44 +09:00
Junio C Hamano
d92dbf1934 Merge branch 'jk/submodule-init-segv-fix'
Fix a segv in 'submodule init' when url is not given for a submodule.

* jk/submodule-init-segv-fix:
  submodule_init: die cleanly on submodules without url defined
2017-05-01 14:14:44 +09:00
Junio C Hamano
b0f89870ea Merge branch 'jk/prio-queue-avoid-swap-with-self'
Code clean-up.

* jk/prio-queue-avoid-swap-with-self:
  prio_queue_reverse: don't swap elements with themselves
2017-05-01 14:14:43 +09:00
Junio C Hamano
d9dfed9e47 Merge branch 'ab/align-perf-descriptions'
Output from perf tests have been updated to align their titles.

* ab/align-perf-descriptions:
  t/perf: correctly align non-ASCII descriptions in output
2017-05-01 14:14:42 +09:00
Junio C Hamano
b439747bc1 Merge branch 'jk/complete-checkout-sans-dwim-remote'
Completion for "git checkout <branch>" that auto-creates the branch
out of a remote tracking branch can now be disabled, as this
completion often gets in the way when completing to checkout an
existing local branch that happens to share the same prefix with
bunch of remote tracking branches.

* jk/complete-checkout-sans-dwim-remote:
  completion: optionally disable checkout DWIM
2017-05-01 14:14:41 +09:00
Peter Krefting
78bde923f1 i18n: read-cache: typofix
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 11:08:02 +09:00
Jean-Noel Avila
c3027be9d1 i18n: remove i18n from tag reflog message
The building of the reflog message is using strbuf, which is not
friendly with internationalization frameworks. No other reflog
messages are translated right now and switching all the messages to
i18n would require a major rework of the way the messages are built.

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 11:08:02 +09:00
René Genz
d395745d81 doc: git-pull.txt use US spelling, fix minor typo
Signed-off-by: René Genz <liebundartig@freenet.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 11:03:08 +09:00
René Genz
5621760f59 fix minor typos
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: René Genz <liebundartig@freenet.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 11:01:52 +09:00
Simon Ruderich
501d3cd7b8 githooks.txt: clarify push hooks are always executed in $GIT_DIR
Listing the specific hooks might feel verbose but without it the
reader is left to wonder which hooks are triggered during the
push. Something which is not immediately obvious when only trying
to find out where the hook is executed.

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 10:56:15 +09:00
René Genz
01e60a9a22 doc: update SubmittingPatches
-use US English spelling
-minor wording change for better readability

Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: René Genz <liebundartig@freenet.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-01 09:08:10 +09:00
Stephen Hicks
54fd3243da rebase -i: reread the todo list if exec touched it
In the scripted version of the interactive rebase, there was no internal
representation of the todo list; it was re-read before every command.
That allowed the hack that an `exec` command could append (or even
completely rewrite) the todo list.

This hack was broken by the partial conversion of the interactive rebase
to C, and this patch reinstates it.

We also add a small test to verify that this fix does not regress in the
future.

Signed-off-by: Stephen Hicks <sdh@google.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-27 10:56:26 +09:00
Lars Schneider
dcc3e7f5fd travis-ci: set DEVELOPER knob for Linux32 build
The Linux32 build was not build with our strict compiler settings (e.g.
warnings as errors). Fix this by passing the DEVELOPER environment
variable to the docker container.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-27 10:23:56 +09:00
Lars Schneider
c4b4968397 travis-ci: printf $STATUS as string
If the $STATUS variable contains a "%" character then printf will
interpret that as invalid format string. Fix this by formatting $STATUS
as string.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-26 18:23:19 -07:00
David Aguilar
ede8f145e0 t7800: cleanup cruft left behind by tests
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-26 21:47:04 +02:00
Johannes Schindelin
9f22cae658 Merge pull request #1152 from jeffhostetler/jeffhostetler/msvc_make_clean
Makefile: clean EXE PDBs when MSVC=1
2017-04-26 21:27:43 +02:00
Johannes Schindelin
7a2040a790 Merge branch 'coverity'
Coverity is a tool to analyze code statically, trying to find common (or
not so common) problems before they occur in production.

Coverity offers its services to Open Source software, and just like
upstream Git, Git for Windows applied and was granted the use.

While Coverity reports a lot of false positives due to Git's (ab-)use of
the FLEX_ARRAY feature (where it declares a 0-byte or 1-byte array at the
end of a struct, and then allocates a variable-length data structure
holding a variable-length string at the end, so that the struct as well as
the string can be released with a single free()), there were a few issues
reported that are true positives, and not all of them were resource leaks
in builtins (for which it is considered kind of okay to not release memory
just before exit() is called anyway).

This topic branch tries to address a couple of those issues.

Note: there are a couple more issues left, either because they are tricky
to resolve (in some cases, the custody of occasionally-allocated memory is
very unclear) or because it is unclear whether they are false positives
(due to the hard-to-reason-about nature of the code). It's a start,
though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:22 +02:00
Johannes Schindelin
92d3e5a470 Merge branch 'drive-prefix'
This topic branch allows us to specify absolute paths without the drive
prefix e.g. when cloning.

Example:

	C:\Users\me> git clone https://github.com/git/git \upstream-git

This will clone into a new directory C:\upstream-git, in line with how
Windows interprets absolute paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:21 +02:00
René Scharfe
50cb324840 am: close stream on error, but not stdin
Avoid closing stdin, but do close an actual input file on error exit.

Found with Cppcheck.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-04-26 18:04:20 +02:00
Johannes Schindelin
b9f82c37e5 submodule_uses_worktrees(): plug memory leak
There is really no reason why we would need to hold onto the allocated
string longer than necessary.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:20 +02:00
Johannes Schindelin
5b54a1d4e0 show_worktree(): plug memory leak
The buffer allocated by shorten_unambiguous_ref() needs to be released.

Discovered by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:20 +02:00
Johannes Schindelin
5fdcc9bcfe name-rev: avoid leaking memory in the deref case
When the `name_rev()` function is asked to dereference the tip name, it
allocates memory. But when it turns out that another tip already
described the commit better than the current one, we forgot to release
the memory.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:20 +02:00
Johannes Schindelin
a3ccecf2a7 remote: plug memory leak in match_explicit()
The `guess_ref()` returns an allocated buffer of which `make_linked_ref()`
does not take custody (`alloc_ref()` makes a copy), therefore we need to
release the buffer afterwards.

Noticed via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:20 +02:00
Johannes Schindelin
b495d52e6c add_reflog_for_walk: avoid memory leak
We free()d the `log` buffer when dwim_log() returned 1, but not when it
returned a larger value (which meant that it still allocated the buffer
but we simply ignored it).

Identified by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
5f81ef6460 shallow: avoid memory leak
Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
8ab022a0a7 line-log: avoid memory leak
Discovered by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
db9ce700d4 receive-pack: plug memory leak in update()
Reported via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
1d24c82c57 fast-export: avoid leaking memory in handle_tag()
Reported by, you guessed it, Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
cfb2b4c0d6 mktree: plug memory leaks reported by Coverity
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
8ee6b9fd03 pack-redundant: plug memory leak
Identified via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
1f219890fb setup_discovered_git_dir(): fix memory leak
Identified by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:19 +02:00
Johannes Schindelin
a26de53cee setup_bare_git_dir(): fix memory leak
Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00
Johannes Schindelin
0c405aa991 split_commit_in_progress(): fix memory leak
Reported via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00
Johannes Schindelin
6eb8559847 checkout: fix memory leak
Discovered via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00
Johannes Schindelin
1877204af5 cat-file: fix memory leak
Discovered by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00
Johannes Schindelin
9a63766e6b Check for EOF while parsing mails
Reported via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00
Johannes Schindelin
e2430a0f8a status: close file descriptor after reading git-rebase-todo
Reported via Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-04-26 18:04:18 +02:00