gitpod-io / gitpod-io/leeway

Cannot parse Git status when files are renamed

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

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
183
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Bug description

When files have been renamed, leeway fails to parse the Git status and assumes all files are "dirty":

WARN[0000] cannot parse git status: assuming all files are dirty  error="cannot parse git status \"R  bootstrap/infra/README.md -> bootstrap/README.md\": expected two segments, got 4"
Steps to reproduce

Rename a file in the Git working copy using git mv

Expected behavior

No response

Example repository

No response

Anything else?

No response

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the Git status parsing code that emits the reported error, then reproduce the case with a working-copy file renamed using git mv. Trace how the R bootstrap/infra/README.md -> bootstrap/README.md status line is split, and verify that renamed files are parsed without causing all files to be marked dirty.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.