sdiff: fix the layout of unchanged rows, blank lines and cut tabs
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Work is already claimed by open PR 301. The issue names src/side_diff.rs and confines the change to process_half_line and push_output: print each half’s text, keep the column where output stopped, and pad from that column to the marker and to column two. Compare against GNU diff -y with --width and --expand-tabs using the given L/R examples; done when unchanged rows, blank lines, and cut tabs match GNU layout.
索引モデルが issue の本文から書いたものです。
説明
src/side_diff.rs pads the left half up to a fixed column and writes the right half after it, instead of padding from the column where the text ended. Three rows come out different from GNU diff:
- The right half of an unchanged row starts at
half_width + 3instead of column two. The two are the same at the default--width=130, so it only shows at other widths and with--expand-tabs. - A blank line common to both files is padded up to column two instead of left empty.
- A tab that reaches the end of the half is dropped, and the text after it is still printed. GNU diff cuts the row at that tab.
Tabs are shown as ^I and line ends as $:
$ diff -y --width=40 L R | cat -A # L: a,(blank),b,c R: a,(blank),c
a^I^I a$
^I^I $
b^I^I <$
c^I^I c$
$ diff -y --width=10 L R | cat -A # L: a<TAB>b,c R: c
ab <$
c c$
GNU diff 3.10 prints:
a^I^I^Ia$
$
b^I^I <$
c^I^I^Ic$
a <$
c^Ic$
So the change is confined to process_half_line and push_output. Print only the text of each half, keep the column where the output stopped, and pad from that column to the marker and to column two.
- 主要言語
- Rust
- スター
- 276
- フォーク
- 44
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/diffutils のほかの issue
-
cmp: quiet mode compares full file sizes before applying -n対応中かも @SichenLiang が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)対応中かも @sami-daniel が 59 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflow対応中かも @MsfPablo が 54 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uutils/diffutils#245 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
uutils/diffutils の issue をすべて見る
似ている issue
-
[Bug]: Web chat input doesn't regain focus after a reply finishes対応中かも @GaijinSystems が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
zeroclaw-labs/zeroclaw#11658 ·
メンテナーはふだん 2 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NuSkooler/enigma-bbs#907 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信