Граф коммитов

292 Коммитов

Автор SHA1 Сообщение Дата
Johannes Schindelin 6f3529776e Merge branch 'git-gui-askyesno'
These changes are necessary to support better Git for Windows' new
auto-update feature.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:32 -06:00
Johannes Schindelin 932f761aa3 Merge branch 'git-gui-hooks-path' of https://github.com/dscho/git-gui
Let's try to address #1755 this way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:32 -06:00
Johannes Schindelin 5da66062cf git-gui--askyesno (mingw): use Git for Windows' icon, if available
For additional GUI goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:31 -06:00
Johannes Schindelin 8108a00de9 respect core.hooksPath, falling back to .git/hooks
Since v2.9.0, Git knows about the config variable core.hookspath
that allows overriding the path to the directory containing the
Git hooks.

Since v2.10.0, the `--git-path` option respects that config
variable, too, so we may just as well use that command.

For Git versions older than v2.5.0 (which was the first version to
support the `--git-path` option for the `rev-parse` command), we
simply fall back to the previous code.

This fixes https://github.com/git-for-windows/git/issues/1755

Initial-patch-by: Philipp Gortan <philipp@gortan.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:31 -06:00
Johannes Schindelin 610d32520b git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:31 -06:00
Johannes Schindelin 97370c2ed1 git-gui--askyesno: allow overriding the window title
"Question?" is maybe not the most informative thing to ask. In the
absence of better information, it is the best we can do, of course.

However, Git for Windows' auto updater just learned the trick to use
git-gui--askyesno to ask the user whether to update now or not. And in
this scripted scenario, we can easily pass a command-line option to
change the window title.

So let's support that with the new `--title <title>` option.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:31 -06:00
Heiko Voigt 19ee912669 git-gui: provide question helper for retry fallback on Windows
Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2023-06-01 10:14:31 -06:00
Johannes Schindelin cdcfab4c04 git-gui--askyesno: fix funny text wrapping
The text wrapping seems to be aligned to the right side of the Yes
button, leaving an awful lot of empty space.

Let's try to counter this by using pixel units.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:31 -06:00
Johannes Schindelin c47a9e974f Git GUI: fix Repository>Explore Working Copy (#4357)
This is a companion PR of https://github.com/prati0100/git-gui/pull/95

Since Git v2.39.1, we are a bit more stringent in searching the PATH. In
particular, we specifically require the `.exe` suffix.

However, the `Repository>Explore Working Copy` command asks for
`explorer.exe` to be found on the `PATH`, which _already_ has that
suffix.

Let's unstartle the PATH-finding logic about this scenario.

This fixes https://github.com/git-for-windows/git/issues/4356
2023-06-01 10:14:26 -06:00
Johannes Schindelin 346ad83c06 windows: fix Repository>Explore Working Copy
Since Git v2.39.1, we are a bit more stringent in searching the PATH. In
particular, we specifically require the `.exe` suffix.

However, the `Repository>Explore Working Copy` command asks for
`explorer.exe` to be found on the `PATH`, which _already_ has that
suffix.

Let's unstartle the PATH-finding logic about this scenario.

This fixes https://github.com/git-for-windows/git/issues/4356

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:16 -06:00
Johannes Schindelin e2a3930ad8 git-gui: accommodate for intent-to-add files
As of Git v2.28.0, the diff for files staged via `git add -N` marks them
as new files. Git GUI was ill-prepared for that, and this patch teaches
Git GUI about them.

Please note that this will not even fix things with v2.28.0, as the
`rp/apply-cached-with-i-t-a` patches are required on Git's side, too.

This fixes https://github.com/git-for-windows/git/issues/2779

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2023-06-01 10:14:08 -06:00
Johannes Schindelin dafd42ebd9 Work around Tcl's default `PATH` lookup
As per https://www.tcl.tk/man/tcl8.6/TclCmd/exec.html#M23, Tcl's `exec`
function goes out of its way to imitate the highly dangerous path lookup
of `cmd.exe`, but _of course_ only on Windows:

	If a directory name was not specified as part of the application
	name, the following directories are automatically searched in
	order when attempting to locate the application:

	    The directory from which the Tcl executable was loaded.

	    The current directory.

	    The Windows 32-bit system directory.

	    The Windows home directory.

	    The directories listed in the path.

The dangerous part is the second item, of course: `exec` _prefers_
executables in the current directory to those that are actually in the
`PATH`.

It is almost as if people wanted to Windows users vulnerable,
specifically.

To avoid that, Git GUI already has the `_which` function that does not
imitate that dangerous practice when looking up executables in the
search path.

However, Git GUI currently fails to use that function e.g. when trying to
execute `aspell` for spell checking.

That is not only dangerous but combined with Tcl's unfortunate default
behavior and with the fact that Git GUI tries to spell-check a
repository just after cloning, leads to a critical Remote Code Execution
vulnerability.

Let's override both `exec` and `open` to always use `_which` instead of
letting Tcl perform the path lookup, to prevent this attack vector.

This addresses CVE-2022-41953.

For more details, see
https://github.com/git-for-windows/git/security/advisories/GHSA-v4px-mx59-w99c

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:03 -06:00
Johannes Schindelin 832b054e69 Move the `_which` function (almost) to the top
We are about to make use of the `_which` function to address
CVE-2022-41953 by overriding Tcl/Tk's unsafe PATH lookup on Windows.

In preparation for that, let's move it close to the top of the file to
make sure that even early `exec` calls that happen during the start-up
of Git GUI benefit from the fix.

This commit is best viewed with `--color-moved`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:03 -06:00
Johannes Schindelin ac681d3437 Move is_<platform> functions to the beginning
We need these in `_which` and they should be defined before that
function's definition.

This commit is best viewed with `--color-moved`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:03 -06:00
Johannes Schindelin 0c7c5eb2cf is_Cygwin: avoid `exec`ing anything
The `is_Cygwin` function is used, among other things, to determine
how executables are discovered in the `PATH` list by the `_which` function.

We are about to change the behavior of the `_which` function on Windows
(but not Cygwin): On Windows, we want it to ignore empty elements of the
`PATH` instead of treating them as referring to the current directory
(which is a "legacy feature" according to
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03,
but apparently not explicitly deprecated, the POSIX documentation is
quite unclear on that even if the Cygwin project itself considers it to
be deprecated: https://github.com/cygwin/cygwin/commit/fc74dbf22f5c).

This is important because on Windows, `exec` does something very unsafe
by default (unless we're running a Cygwin version of Tcl, which follows
Unix semantics).

However, we try to `exec` something _inside_ `is_Cygwin` to determine
whether we're running within Cygwin or not, i.e. before we determined
whether we need to handle `PATH` specially or not. That's a Catch-22.

Therefore, and because it is much cleaner anyway, use the
`$::tcl_platform(os)` value which is guaranteed to start with `CYGWIN_`
when running a Cygwin variant of Tcl/Tk, instead of executing `cygpath
--windir`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:03 -06:00
Johannes Schindelin 3218429046 windows: ignore empty `PATH` elements
When looking up an executable via the `_which` function, Git GUI
imitates the `execlp()` strategy where the environment variable `PATH`
is interpreted as a list of paths in which to search.

For historical reasons, stemming from the olden times when it was
uncommon to download a lot of files from the internet into the current
directory, empty elements in this list are treated as if the current
directory had been specified.

Nowadays, of course, this treatment is highly dangerous as the current
directory often contains files that have just been downloaded and not
yet been inspected by the user. Unix/Linux users are essentially
expected to be very, very careful to simply not add empty `PATH`
elements, i.e. not to make use of that feature.

On Windows, however, it is quite common for `PATH` to contain empty
elements by mistake, e.g. as an unintended left-over entry when an
application was installed from the Windows Store and then uninstalled
manually.

While it would probably make most sense to safe-guard not only Windows
users, it seems to be common practice to ignore these empty `PATH`
elements _only_ on Windows, but not on other platforms.

Sadly, this practice is followed inconsistently between different
software projects, where projects with few, if any, Windows-based
contributors tend to be less consistent or even "blissful" about it.
Here is a non-exhaustive list:

Cygwin:

	It specifically "eats" empty paths when converting path lists to
	POSIX: https://github.com/cygwin/cygwin/commit/753702223c7d

	I.e. it follows the common practice.

PowerShell:

	It specifically ignores empty paths when searching the `PATH`.
	The reason for this is apparently so self-evident that it is not
	even mentioned here:
	https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables#path-information

	I.e. it follows the common practice.

CMD:

	Oh my, CMD. Let's just forget about it, nobody in their right
	(security) mind takes CMD as inspiration. It is so unsafe by
	default that we even planned on dropping `Git CMD` from Git for
	Windows altogether, and only walked back on that plan when we
	found a super ugly hack, just to keep Git's users secure by
	default:

		https://github.com/git-for-windows/MINGW-packages/commit/82172388bb51

	So CMD chooses to hide behind the battle cry "Works as
	Designed!" that all too often leaves users vulnerable. CMD is
	probably the most prominent project whose lead you want to avoid
	following in matters of security.

Win32 API (`CreateProcess()`)

	Just like CMD, `CreateProcess()` adheres to the original design
	of the path lookup in the name of backward compatibility (see
	https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
	for details):

		If the file name does not contain a directory path, the
		system searches for the executable file in the following
		sequence:

		    1. The directory from which the application loaded.

		    2. The current directory for the parent process.

		    [...]

	I.e. the Win32 API itself chooses backwards compatibility over
	users' safety.

Git LFS:

	There have been not one, not two, but three security advisories
	about Git LFS executing executables from the current directory by
	mistake. As part of one of them, a change was introduced to stop
	treating empty `PATH` elements as equivalent to `.`:
	https://github.com/git-lfs/git-lfs/commit/7cd7bb0a1f0d

	I.e. it follows the common practice.

Go:

	Go does not follow the common practice, and you can think about
	that what you want:
	https://github.com/golang/go/blob/go1.19.3/src/os/exec/lp_windows.go#L114-L135
	https://github.com/golang/go/blob/go1.19.3/src/path/filepath/path_windows.go#L108-L137

Git Credential Manager:

	It tries to imitate Git LFS, but unfortunately misses the empty
	`PATH` element handling. As of time of writing, this is in the
	process of being fixed:
	https://github.com/GitCredentialManager/git-credential-manager/pull/968

So now that we have established that it is a common practice to ignore
empty `PATH` elements on Windows, let's assess this commit's change
using Schneier's Five-Step Process
(https://www.schneier.com/crypto-gram/archives/2002/0415.html#1):

Step 1: What problem does it solve?

	It prevents an entire class of Remote Code Execution exploits via
	Git GUI's `Clone` functionality.

Step 2: How well does it solve that problem?

	Very well. It prevents the attack vector of luring an unsuspecting
	victim into cloning an executable into the worktree root directory
	that Git GUI immediately executes.

Step 3: What other security problems does it cause?

	Maybe non-security problems: If a project (ab-)uses the unsafe
	`PATH` lookup. That would not only be unsafe, though, but
	fragile in the first place because it would break when running
	in a subdirectory. Therefore I would consider this a scenario
	not worth keeping working.

Step 4: What are the costs of this measure?

	Almost nil, except for the time writing up this commit message
	;-)

Step 5: Given the answers to steps two through four, is the security
	measure worth the costs?

	Yes. Keeping Git's users Secure By Default is worth it. It's a
	tiny price to pay compared to the damages even a single
	successful exploit can cost.

So let's follow that common practice in Git GUI, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-01 10:14:03 -06:00
Ævar Arnfjörð Bjarmason 67b36879fc Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4
Since GNU make 4.4 the semantics of the $(MAKEFLAGS) variable has
changed in a backward-incompatible way, as its "NEWS" file notes:

  Previously only simple (one-letter) options were added to the MAKEFLAGS
  variable that was visible while parsing makefiles.  Now, all options are
  available in MAKEFLAGS.  If you want to check MAKEFLAGS for a one-letter
  option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return
  the set of one-letter options which can be examined via findstring, etc.

This upstream change meant that e.g.:

	make man

Would become very noisy, because in shared.mak we rely on extracting
"s" from the $(MAKEFLAGS), which now contains long options like
"--jobserver-auth=fifo:<path>", which we'll conflate with the "-s"
option.

So, let's change this idiom we've been carrying since [1], [2] and [3]
as the "NEWS" suggests.

Note that the "-" in "-$(MAKEFLAGS)" is critical here, as the variable
will always contain leading whitespace if there are no short options,
but long options are present. Without it e.g. "make --debug=all" would
yield "--debug=all" as the first word, but with it we'll get "-" as
intended. Then "-s" for "-s", "-Bs" for "-s -B" etc.

1. 0c3b4aac8e (git-gui: Support of "make -s" in: do not output
   anything of the build itself, 2007-03-07)
2. b777434383 (Support of "make -s": do not output anything of the
   build itself, 2007-03-07)
3. bb2300976b (Documentation/Makefile: make most operations "quiet",
   2009-03-27)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-12-01 07:24:12 +09:00
Junio C Hamano 85c787f1e9 Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  Revert "git-gui: remove lines starting with the comment character"
2021-03-04 12:38:50 -08:00
Junio C Hamano 90917373cd Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: remove lines starting with the comment character
  git-gui: fix typo in russian locale
2021-03-01 09:22:18 -08:00
Junio C Hamano f4d8e19123 Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: use gray background for inactive text widgets
  git-gui: Fix selected text colors
  Makefile: conditionally include GIT-VERSION-FILE
  git-gui: fix colored label backgrounds when using themed widgets
  git-gui: ssh-askpass: add a checkbox to show the input text
  git-gui: update Russian translation
  git-gui: use commit message template
  git-gui: Only touch GITGUI_MSG when needed
2020-12-18 15:07:10 -08:00
Junio C Hamano 430cabb104 Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: blame: prevent tool tips from sticking around after Command-Tab
  git-gui: improve dark mode support
  git-gui: fix mixed tabs and spaces; prefer tabs
2020-10-17 13:10:58 -07:00
Junio C Hamano e7ae437ac1 Merge https://github.com/prati0100/git-gui into master
* https://github.com/prati0100/git-gui:
  git-gui: allow opening work trees from the startup dialog
2020-07-20 12:04:06 -07:00
Junio C Hamano ae92ac8ae3 Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: Handle Ctrl + BS/Del in the commit msg
  Subject: git-gui: fix syntax error because of missing semicolon
2020-05-21 11:15:04 -07:00
Junio C Hamano 98cedd0233 Merge https://github.com/prati0100/git-gui
* 'master' of https://github.com/prati0100/git-gui:
  git-gui: create a new namespace for chord script evaluation
  git-gui: reduce Tcl version requirement from 8.6 to 8.5
  git-gui--askpass: coerce answers to UTF-8 on Windows
  git-gui: fix error popup when doing blame -> "Show History Context"
  git-gui: add missing close bracket
  git-gui: update German translation
  git-gui: extend translation glossary template with more terms
  git-gui: update pot template and German translation to current source code
2020-03-19 16:06:51 -07:00
Junio C Hamano fe47c9cb5f Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: allow opening currently selected file in default app
  git-gui: allow closing console window with Escape
  git gui: fix branch name encoding error
  git-gui: revert untracked files by deleting them
  git-gui: update status bar to track operations
  git-gui: consolidate naming conventions
2020-01-08 11:18:06 -08:00
Junio C Hamano ab6b50e4c8 Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
  git-gui: improve Japanese translation
  git-gui: add a readme
  git-gui: support for diff3 conflict style
  git-gui: use existing interface to query a path's attribute
  git-gui (Windows): use git-bash.exe if it is available
  treewide: correct several "up-to-date" to "up to date"
  Fix build with core.autocrlf=true
2019-11-04 13:29:38 +09:00
Junio C Hamano 7e1976e210 Merge branch 'master' of https://github.com/prati0100/git-gui
* 'master' of https://github.com/prati0100/git-gui:
  git-gui: add hotkey to toggle "Amend Last Commit"
  git-gui: add horizontal scrollbar to commit buffer
  git-gui: convert new/amend commit radiobutton to checkbutton
  git-gui: add hotkeys to set widget focus
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines
2019-09-18 11:22:11 -07:00
Junio C Hamano 0d88f3d2c5 Merge branch 'py/call-do-quit-before-exit' of github.com:gitster/git-gui into py/git-gui-do-quit
* 'py/call-do-quit-before-exit' of github.com:gitster/git-gui:
  git-gui: call do_quit before destroying the main window
2019-08-07 13:26:06 -07:00
Junio C Hamano 18a6a8571f Merge branch 'cb/git-gui-ttk-style'
"git gui" has been taught to work with old versions of tk (like
8.5.7) that do not support "ttk::style theme use" as a way to query
the current theme.

* cb/git-gui-ttk-style:
  git-gui: workaround ttk:style theme use
2018-04-25 13:28:49 +09:00
Junio C Hamano b1218e46a6 Merge branch 'bp/git-gui-bind-kp-enter'
"git gui" performs commit upon CTRL/CMD+ENTER but the
CTRL/CMD+KP_ENTER (i.e. enter key on the numpad) did not have the
same key binding.  It now does.

* bp/git-gui-bind-kp-enter:
  git-gui: bind CTRL/CMD+numpad ENTER to do_commit
2018-04-25 13:28:48 +09:00
Junio C Hamano 4891961105 Merge branch 'cb/ttk-style' of git-gui into cb/git-gui-ttk-style
* 'cb/ttk-style' of git-gui:
  git-gui: workaround ttk:style theme use
2018-03-05 23:48:01 -08:00
Junio C Hamano 2e2f0288ef Merge branch 'bb/ssh-key-files' of git-gui into bb/git-gui-ssh-key-files
* 'bb/ssh-key-files' of git-gui:
  git-gui: search for all current SSH key types
2018-03-02 15:17:35 -08:00
Junio C Hamano 28a1d94a06 Merge branch 'bp/bind-kp-enter' of git-gui into bp/git-gui-bind-kp-enter
* 'bp/bind-kp-enter' of git-gui:
  git-gui: bind CTRL/CMD+numpad ENTER to do_commit
2018-03-02 15:16:34 -08:00
Junio C Hamano 02a5f25d95 Merge branch 'js/misc-git-gui-stuff' of ../git-gui
* 'js/misc-git-gui-stuff' of ../git-gui:
  git-gui: allow Ctrl+T to toggle multiple paths
  git-gui: fix exception when trying to stage with empty file list
  git-gui: avoid exception upon Ctrl+T in an empty list
  git gui: fix staging a second line to a 1-line file
2018-01-09 11:07:03 -08:00
Junio C Hamano e7d1b526d1 Merge branch 'ls/git-gui-no-double-utf8-author-name'
Amending commits in git-gui broke the author name that is non-ascii
due to incorrect enconding conversion.

* ls/git-gui-no-double-utf8-author-name:
  git-gui: prevent double UTF-8 conversion
2017-12-19 11:33:56 -08:00
Junio C Hamano 77e4224390 Merge branch 'ls/no-double-utf8-author-name' of ../git-gui into ls/git-gui-no-double-utf8-author-name
* 'ls/no-double-utf8-author-name' of ../git-gui:
  git-gui: prevent double UTF-8 conversion
2017-12-05 09:20:12 -08:00
Junio C Hamano da10ea373b Merge branch 'jn/reproducible-build' of ../git-gui into jn/reproducible-build
* 'jn/reproducible-build' of ../git-gui:
  git-gui: sort entries in optimized tclIndex
2017-11-22 14:57:52 +09:00
Junio C Hamano 5313bee032 Merge branch 'tz/fsf-address-update' of ../git-gui into tz/fsf-address-update
* 'tz/fsf-address-update' of ../git-gui:
  Replace Free Software Foundation address in license notices
2017-11-09 13:24:43 +09:00
Junio C Hamano 8e36002add Merge branch 'ma/up-to-date'
Message and doc updates.

* ma/up-to-date:
  treewide: correct several "up-to-date" to "up to date"
  Documentation/user-manual: update outdated example output
2017-09-10 17:08:22 +09:00
Martin Ågren 7560f547e6 treewide: correct several "up-to-date" to "up to date"
Follow the Oxford style, which says to use "up-to-date" before the noun,
but "up to date" after it. Don't change plumbing (specifically
send-pack.c, but transport.c (git push) also has the same string).

This was produced by grepping for "up-to-date" and "up to date". It
turned out we only had to edit in one direction, removing the hyphens.

Fix a typo in Documentation/git-diff-index.txt while we're there.

Reported-by: Jeffrey Manian <jeffrey.manian@gmail.com>
Reported-by: STEVEN WHITE <stevencharleswhitevoices@gmail.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-23 12:17:22 -07:00
Junio C Hamano 90dbf226ba Merge branch 'js/msgfmt-on-windows' of ../git-gui into js/git-gui-msgfmt-on-windows
* 'js/msgfmt-on-windows' of ../git-gui:
  git-gui (MinGW): make use of MSys2's msgfmt
  git gui: allow for a long recentrepo list
  git gui: de-dup selected repo from recentrepo history
  git gui: cope with duplicates in _get_recentrepo
  git-gui: remove duplicate entries from .gitconfig's gui.recentrepo
2017-07-25 13:42:41 -07:00
Johannes Schindelin 00ddc9d13c Fix build with core.autocrlf=true
On Windows, the default line endings are denoted by a Carriage Return
byte followed by a Line Feed byte, while Linux and MacOSX use a single
Line Feed byte to denote a line ending.

To help with this situation, Git introduced several mechanisms over the
last decade, most prominently the `core.autocrlf` setting.

Sometimes, however, a single setting is incorrect, e.g. when certain
files in the source code are to be consumed by software that can handle
only LF line endings, while other files can use whatever is appropriate
for the current platform.

To allow for that, Git added the `eol` option to its .gitattributes
handling, expecting every user of Git to mark their source code
appropriately.

Bash assumes that line-endings of scripts are denoted by a single Line
Feed byte. Therefore, shell scripts in Git's source code are one example
where that `eol=lf` option is *required*.

When generating common-cmds.h, the Unix tools we use generally operate on
the assumption that input and output deliminate their lines using LF-only
line endings. Consequently, they would happily copy the CR byte verbatim
into the strings in common-cmds.h, which in turn makes the C preprocessor
barf (that interprets them as MacOS-style line endings). Therefore, we
have to mark the input files as LF-only: command-list.txt and
Documentation/git-*.txt.

Quite a bit belatedly, this patch brings Git's own source code in line
with those expectations by setting those attributes to allow for a
correct build even when core.autocrlf=true.

This patch can be validated even on Linux, by using this cadence:

	git config core.autocrlf true
	rm .git/index && git stash
	make -j15 DEVELOPER=1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-10 13:32:50 +09:00
Junio C Hamano 3eae308700 git-gui 0.21.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJYCJqmAAoJEDn3Aot9nM55uKQP/11BTzhOr9K3SLzwCr01ylGP
 94AOA511vx3fIX5aWQ29S96tGbluo73RdbVsWFKKJcKSErpFPscFEiRkyjeMXE2T
 yWWOPOg08tm28ppZNp0Kqjb8VykUUKuG6gVT59DNFUZUqHYQbiQy+t8nwT+Qow3U
 dvo6lksovfSaW2FORWIi5KF5gD4v2F9qsbFgr725a8UoBrOmF0SWaCG4/ZYj0WxF
 0rq8LjpvmMuQqd06DAoGMIsHa71R61En2QWfJ4YoE5+QRq8wQl37FmX+ojiA1rzY
 CG/vJO2Tw4v54wHKK1TCXG7LR4JhTcQZOa6zd8HHsPRn+viGDCMVUG9uMewfxH+m
 F47EVMxiKf0subm3fUhycqkvso0r6mOAddhz47RKT7tqU4XOnhPyGw0x6m7evawg
 Sz2+fOK3wwX2Qec5o3vBZKaEcOftSrLuZmbi5/j43crvcf+OAs9s/jdq/Ulpkks2
 JI2i0DLzHABTbDn6QsuysEZnituks8T8Fdm5NOldritgBNVY81ifatekFscxt6Ct
 OrT9eGJk6iZiX1RvS+R7wykKJCBkxiyHqM8vSj5tPWjApgtnopPMudzNX41geaL9
 ADeb8LVMTTNL/md8KED0deypilcPNnPbW035rAbyCpAsKbtgO3zdfzdzxsQ+dIvc
 MQpCDP5QPPr3toRVdNmb
 =VyhL
 -----END PGP SIGNATURE-----

Merge tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui

git-gui 0.21.0

* tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui: (22 commits)
  git-gui: set version 0.21
  git-gui: Mark 'All' in remote.tcl for translation
  git-gui i18n: Updated Bulgarian translation (565,0f,0u)
  git-gui: avoid persisting modified author identity
  git-gui: handle the encoding of Git's output correctly
  git-gui: unicode file name support on windows
  git-gui: Update Russian translation
  git-gui: maintain backwards compatibility for merge syntax
  git-gui i18n: mark string in lib/error.tcl for translation
  git-gui: fix incorrect use of Tcl append command
  git-gui i18n: mark "usage:" strings for translation
  git-gui i18n: internationalize use of colon punctuation
  git-gui: ensure the file in the diff pane is in the list of selected files
  git-gui: support for $FILENAMES in tool definitions
  git-gui: fix initial git gui message encoding
  git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution
  git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`
  git-gui: fix detection of Cygwin
  Amend tab ordering and text widget border and highlighting.
  Allow keyboard control to work in the staging widgets.
  ...
2016-10-20 09:33:17 -07:00
Junio C Hamano cb3debdc12 Merge branch 'va/git-gui-i18n'
"git gui" l10n to Portuguese.

* va/git-gui-i18n:
  git-gui: l10n: add Portuguese translation
  git-gui i18n: mark strings for translation
2016-10-03 13:30:37 -07:00
Junio C Hamano 5a2c86fb08 Merge branch 'rs/git-gui-use-modern-git-merge-syntax'
The original command line syntax for "git merge", which was "git
merge <msg> HEAD <parent>...", has been deprecated for quite some
time, and "git gui" was the last in-tree user of the syntax.  This
is finally fixed, so that we can move forward with the deprecation.

* rs/git-gui-use-modern-git-merge-syntax:
  git-gui: stop using deprecated merge syntax
2016-10-03 13:30:37 -07:00
Junio C Hamano 0219a05721 Merge branch 'va/i18n' of ../git-gui into va/git-gui-i18n
* 'va/i18n' of ../git-gui:
  git-gui: l10n: add Portuguese translation
  git-gui i18n: mark strings for translation
2016-09-26 07:19:57 -07:00
Junio C Hamano ff65e796f0 Merge branch 'rs/use-modern-git-merge-syntax' of git-gui into rs/git-gui-use-modern-git-merge-syntax
* 'rs/use-modern-git-merge-syntax' of git-gui:
  git-gui: stop using deprecated merge syntax
2016-09-26 07:16:48 -07:00
Junio C Hamano e6a51afba4 Merge branch 'js/git-gui-commit-gpgsign'
"git commit-tree" stopped reading commit.gpgsign configuration
variable that was meant for Porcelain "git commit" in Git 2.9; we
forgot to update "git gui" to look at the configuration to match
this change.

* js/git-gui-commit-gpgsign:
  git-gui: respect commit.gpgsign again
2016-09-15 14:11:16 -07:00
Junio C Hamano f14a310e8b Merge branch 'js/commit-gpgsign' of ../git-gui into js/git-gui-commit-gpgsign
* 'js/commit-gpgsign' of ../git-gui:
  git-gui: respect commit.gpgsign again
2016-09-11 14:54:46 -07:00
Junio C Hamano 02748bc7bb Merge branch 'sy/i18n' of git-gui
* 'sy/i18n' of git-gui:
  git-gui: update Japanese information
  git-gui: update Japanese translation
  git-gui: add Japanese language code
  git-gui: apply po template to Japanese translation
  git-gui: consistently use the same word for "blame" in Japanese
  git-gui: consistently use the same word for "remote" in Japanese
2016-09-07 10:24:25 -07:00