Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

sdiff: fix the layout of unchanged rows, blank lines and cut tabs

Open
#300 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sami-daniel is already working on this.

Since Oct 6, 2026.

  • #301 by @sami-daniel — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
28/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

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.

Written by the indexing model from the issue text.

Description

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 + 3 instead 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.

Dominant language
Rust
Stars
276
Forks
44
Avg merge
1d 23h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/diffutils

All issues in uutils/diffutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.