Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分割ファイルの扱い #2035

Open
tatsuo-ishii opened this issue Sep 27, 2021 · 4 comments
Open

分割ファイルの扱い #2035

tatsuo-ishii opened this issue Sep 27, 2021 · 4 comments

Comments

@tatsuo-ishii
Copy link
Contributor

tatsuo-ishii commented Sep 27, 2021

重要度: (中)

問題点

分割ファイルでレビューしていただいた結果を、分割ファイルの元になっているファイルに反映するのが手間です。

背景

分割ファイルの行位置と、元になっているファイルの行位置のずれによるものです。そのため、元のファイルの中を検索しないと修正が必要な位置がわかりません。
分割ファイルになっているファイルは大きいため、この手間が一層大きくなります。

解決方法

コンパイル対象自体を分割ファイルにする。

注意点

翻訳作業開始時のマージ作業が困難になるかもしれません。
解決方法としては、

  1. 新バージョンを最初に分割ファイルにしてしまい、それからマージする
  2. 前回の分割翻訳ファイルを合体して分割しない翻訳ファイルを作り、それを新バージョンのファイルにマージする

などが考えられます。

@noborus
Copy link
Contributor

noborus commented Sep 29, 2021

これは、ちょっと避けたいと思いました。
ファイルを分割するのをやめて、(翻訳の場合は)Pull Requestを小さな単位で送るほうが良いのではと思います。
翻訳でない一括変換等の場合は、ブラウザで見るのを諦めてもらわないと難しいです。

@tatsuo-ishii
Copy link
Contributor Author

ブラウザで見て差分が正しく表示されない現象は、pull requestの量(差分の量)に関係なく、対象となるファイルの大きさに依存すると想います。ですので、Pull Requestを小さな単位で送っても問題が解決されないという理解ですが、間違っていますか?

@noborus
Copy link
Contributor

noborus commented Sep 29, 2021

https://docs.github.com/ja/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/limits-for-viewing-content-and-diffs-in-a-repository
制限的には両方あって、diffのみの場合は小さくしていれば見られると思います。
試しにfunc.sgmlを分割してコミットしてみました。見られるか確認してみてもらえますでしょうか?

https://github.com/noborus/jpug-doc/pull/11/files
https://github.com/noborus/jpug-doc/pull/12/files
https://github.com/noborus/jpug-doc/pull/13/files
https://github.com/noborus/jpug-doc/pull/14/files
https://github.com/noborus/jpug-doc/pull/15/files

コミットの分割方法として以下でやりました。
ブランチ作成

$ git switch -c トピックブランチ名  doc_ja_13等
$ git add -p #で分割して追加する
# y で10〜20ブロックぐらいまで追加 qで終了
$ git commit -m "コミットログ"
# ブランチの移動が出来ないので一旦stash
$ git stash
$ git  switch -c トピックブランチ名  doc_ja_13等
# ブランチを移動してから stash pop
$ git stash pop
# 以下 git add -p から繰り返し 
git push origin トピックブランチ名
# ブランチ分プッシュ

@tatsuo-ishii
Copy link
Contributor Author

見られました。
しかし、よく考えたら、ワークフローを変えるだけで、問題を解決できそうです。

  1. 分割ファイルにレビュー結果を反映する(分割前のファイルではなく)
  2. 分割ファイルを結合して元のファイルに反映
  3. 元のファイルと分割ファイルの両方をpull request

つまり、わざわざ分割ファイルのレビュー結果を元のファイルの該当箇所に手動で反映するのではなく、分割ファイルを修正してから、それを元のファイルに機械的に反映すればよいのでした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants