basyura's blog

あしたになったらほんきだす。

GitLab - Merge Conflict Resolution & Merge Conflict Editor は日本語が通らない

8.11 で Merge Conflict Resolution をリリース。

8.13 で Merge Conflict Editor をリリース。

ただし、これらを使用するには条件がある。

  1. If the file contains conflict markers that mean we can't parse the file unambiguously, we can't show the sections. We will, however, be able to allow resolving those conflicts in an editor.

  2. If the file is a binary file, we can't parse the file for conflict markers because they are only added to text files. Again, we plan to allow resolving conflicts in binary files in the future.

  3. If the file isn't in a UTF-8 compatible encoding, we can't allow resolving it because we pass data back and forth as JSON.

  4. If the file is too large (over 200 KB), we avoid parsing it.

ぱっと見そんなもんかなと思っていたのだけどちょっと違った。

3 . If the file isn't in a UTF-8 compatible encoding, we can't allow resolving it because we pass data back and forth as JSON.

UTF-8 なファイルであれば問題ないと思っていたのだけどファイルの中に日本語(?)が一文字でもあるとダメっぽい。ASCII 文字のみで構成されているファイルの場合にだけ使えるという表現のほうが正しいのだろうか(?)。

理由はJSON 変換で困るからっぽいけど・・・英語圏以外ではほぼ使えない状態なんでは。今後の改善に期待 (自分で調べろっていう)。

実際の Merge Request でのコンフリクト解消方法はこんな感じ。

  • Merge Request にある Target branch → Source branch にマージ
  • GitLab UI 上で直してマージコミットを作る(全て解消しないとコミットボタンが有効にならない)
  • Accept Merge Request ボタンで Source branch → Target branch にマージ

グラフにするとこんな感じ。

*   1f7fd33 (HEAD -> master, origin/master) Merge branch 'cat' into ‘master’
|                                           ↑`Accept Merge Request` でマージ
|\  
| *   54d0941 Merge branch 'master' into ‘cat’ ← GitLab UI 上でコンフリクト解消
| |\  
| |/  
|/|   
* | df4a6a4 master に cat とコンフリクトするコミットを追加
| * de47b7a (origin/cat, cat) cat ブランチを追加してコンフリクトするコミットを追加
|/  
* 2697d30 first commit

複数人でちょっとずつコンフリクト解消できるかな、と期待していたのでちょっと違った。けど、GitLab の今の勢いならもっと良くなっていくに違いない ( ー`дー´)キリッ