Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Merge request for newer version of an/vim-utf-8#3

Merged
dscho merged 2 commits intomsysgit:develfrom
atnak:an/vim-utf-8
Feb 23, 2012
Merged

Merge request for newer version of an/vim-utf-8#3
dscho merged 2 commits intomsysgit:develfrom
atnak:an/vim-utf-8

Conversation

@atnak
Copy link
Copy Markdown
Contributor

@atnak atnak commented Feb 8, 2012

We avoid setting `encoding' and `termencoding', and opt to only setting
`fileencodings' because it's understood that vim sets the former two to
the user's system's "ANSI" and "OEM" code pages (setting either both if
they differ or only `encoding' if they're the same) [1].  The setting of
"OEM" is particularly significant as it is required for native characters
to be correctly displayed on the user's console [2].

We set "utf-8" as the only value of `fileencodings', there by making it
the default encoding used to save new commit messages to COMMIT_EDITMSG.
This is consistent with what git expects in an environment where the
user has not altered the value of `i18n.commitencoding'.

When loading an existing message, for operations such as 'commit --amend'
and 'rebase -i', our setting for `fileencodings' means that vim will first
attempt to load it as UTF-8 and then fallback to the encoding set by
`encoding' if unable to do so.  This encoding is expected to be "ANSI",
as mentioned above, and this side-effect is of benefit if the user does
have an altered value of `i18n.commitencoding'.  (Here, we're assuming
users not set this, if at all, to anything other than that of "ANSI"
because that is thought to be the most natural for their location.)

Users SHOULD unset `i18n.commitencoding' after this is released.  However,
failing to do so may not show any visible regressions.  (See tests for
case msysgit#2 at [3].)

This patch follows the discussion in the [4] link.

[1] http://groups.google.com/group/msysgit/msg/be6218f1cbf5e747
[2] http://groups.google.com/group/vim_dev/msg/3dd77f3014a60e43
[3] http://groups.google.com/group/msysgit/msg/508cca8b57f00546
[4] http://groups.google.com/group/msysgit/msg/55c582fb1b279d08
This merge supercedes an older version of 'an/vim-utf-8' (6017a8d...)
which was under github/msysgit and was merged into 'devel' in favour
of a newer version under github/atnak (ee24d5b...).

This merge was created using `git merge -s ours <older_version>'.

The discussion pertaining to this merge follows:

On Wed, 08 Feb 2012 10:28:36 +0900
Atsushi Nakagawa <[email protected]> wrote:
> Oops, I just noticed that the version of "an/vim-utf-8" that was merged
> is an older version in msysgit/msysgit[1] which I couldn't work out how
> to push over.
>
> The last version that I pushed was to atnak/msysgit[2] and this list[3].
> The only delta (aside from the commit message) is an addition of
> "git-rebase-todo" to the file name pattern (for `rebase -i').
>
> [...]
>
> [1] https://github.com/msysgit/msysgit/tree/an/vim-utf-8
> [2] https://github.com/atnak/msysgit/commits/an/vim-utf-8
> [3] http://groups.google.com/group/msysgit/browse_thread/thread/ab5ad659831b0fe0
@ghost ghost assigned dscho Feb 23, 2012
@dscho dscho merged commit 1a871b0 into msysgit:devel Feb 23, 2012
@dscho
Copy link
Copy Markdown
Member

dscho commented Feb 23, 2012

Thanks, and sorry for taking so long!

toshiyuki-ogawa pushed a commit to toshiyuki-ogawa/msysgit that referenced this pull request May 3, 2013
"git add -u" updates the index with the updated contents from the working
tree by internally running "diff-files" to grab the set of paths that are
different from the index. Then it updates the index entries for the paths
that are modified in the working tree, and deletes the index entries for
the paths that are deleted in the working tree.

It ignored the output from the diff-files that indicated that a path is
unmerged.  For these paths, it instead relied on the fact that an unmerged
path is followed by the result of comparison between stage msysgit#2 (ours) and
the working tree, and used that to update or delete such a path when it is
used to record the resolution of a conflict.

As the result, when a path did not have stage msysgit#2 (e.g. "we deleted while
the other side added"), these unmerged stages were left behind, instead of
recording what the user resolved in the working tree.

Since we recently fixed "diff-files" to indicate if the corresponding path
exists on the working tree for an unmerged path, we do not have to rely on
the comparison with stage msysgit#2 anymore. We can instead tell the diff-files
not to compare with higher stages, and use the unmerged output to update
the index to reflect the state of the working tree.

The changes to the test vector in t2200 illustrates the nature of the bug
and the fix.  The test expected stage msysgit#1 and msysgit#3 entries be left behind,
but it was codifying the buggy behaviour.

Signed-off-by: Junio C Hamano <[email protected]>
toshiyuki-ogawa pushed a commit to toshiyuki-ogawa/msysgit that referenced this pull request May 3, 2013
While identifying the commit merged to our history as "parent msysgit#2" is
technically correct, we will never say "parent msysgit#1" (as that is the tip of
our history before the merge is made), and we rarely would say "parent msysgit#3"
(which would mean the merge is an octopus), especially when responding to
a request to pull a signed tag.

Treat the most common case to merge a single commit specially, and just
say "merged tag '<tagname>'" instead.

Signed-off-by: Junio C Hamano <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants