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

6 Коммитов

Автор SHA1 Сообщение Дата
Dimitrij Mijoski b8c692385f git-extra: force the Notepad helper to use UTF-8
When Notepad is set as commit message editor, this fix adds a UTF-8 BOM
to the file before Notepad opens the file.  This way Notepad is forced
to read and save the file as UTF-8, allowing commit messages with
international characters.

Previosly Notepad opened and saved the file in some ANSI codepage,
while Git was reading the file as UTF-8 creating problems when
international charaters were written.

The fix takes into account rares cases when we manually use other
encoding than UTF-8 for commit messegas via the git config
i18n.commitencoding variable.

Now Notepad is completely usable as commit message editor without using
external tools like Gitpad.

Note: as previously, this special handling only applies if the `notepad`
script is called with a path indicating a file residing inside the
`.git/` directory.

[jes: adjusted code style, fixed checksums, clarified that this really
only affects Git files]

This fixes https://github.com/git-for-windows/git/issues/818 and closes
https://github.com/git-for-windows/build-extra/pull/123.

Signed-off-by: Dimitrij Mijoski <dmjpp@hotmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-15 13:09:27 +02:00
Johannes Schindelin 5e7c0e604b notepad: only treat files inside .git/ specially
We want to ensure that files inside .git/ (which have LF line endings)
are edited correctly with Notepad. But we really do not have any
business meddling with other files. So let's only activate the
dos2unix/unix2dos dance, as well as the wrapping of commit messages,
when editing files inside .git/, as suggested by Congyi Wu.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-11-09 20:34:42 +01:00
Johannes Schindelin 66c513aa94 git-extra: fix notepad usage for commit messages
Uh oh. It seems that the patch that got merged into `master` somehow
was not the patch that was tested, but instead a faulty one.

The problem was that `git config <key>` returns an error if the
key was not found and it made the code fail when no column wrapping
was configured (and besides, the test for the column wrapping was
inverted).

To prove that *this* commit is good, it was made using

	git -c core.editor=notepad -c format.commitmessagecolumns=72
	commit -s

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-11-09 19:32:00 +01:00
Johannes Schindelin cdf9294eb7 git-extra: fix source package building
There is a convenient command to build source packages from the same
definitions as the packages were built.

However, the way we built git-extra, we did not really prepare the
sources correctly. As a consequence, a source package would not contain
*any* sources.

Let's fix that.

We need to specify all the source files explicitly. Sadly, this means we
have to put the sources back into a flat file hierarchy due to a bug in
Pacman where it interprets relative paths incorrectly unless they refer
to files in the top-level directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-10-30 10:19:07 +00:00
Johannes Schindelin 0050c2641b git-extra: organize the files a bit
It gets slightly cluttered in the `git-extra/` directory...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-19 15:36:03 +02:00
Johannes Schindelin 69b301bbd7 git-extra: wrap 'notepad' so it can serve as Git's editor
Windows' notepad.exe handles only DOS line endings and it cannot wrap
any lines. That makes it less useful as a commit message editor.

So let's wrap it in a shell script that adds DOS line endings before,
and strips them after running notepad.exe.

Also, to make it appropriate as commit message editor, interpret a
new config variable "format.commitMessageColumns" and line-wrap the
commit message accordingly.

This very commit message, in fact, was written using that notepad
wrapper with "format.commitMessageColumns" set to 72.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-14 16:02:03 +02:00