altsem / altsem/gitu

Feature: Staging from a stash

Open
#431 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Description

I discovered an unexpected behaviour, if you show a stash you can stage (and apparently unstage, according to ?) changes from the stash view. Presumably ? should show what is actually possible, since unstaging changes from the stash doesn't make much sense.

Staging a file tries to do git add the_file which usually doesn't do anything.

Staging a hunk will apply a reverse patch of the hunk in the stash. Which is quite weird because the diff is "changing" something that never existed in the first place, if you then unstage that then the change disappears altogether.

When I first did this, I thought I'd discovered an amazing feature because I often have stashes that are not well-factored, and being able to stage individual pieces out of them without having to unstash (and deal with potential conflicts I dont' care about) would be incredible.

Contributor guide

No contributing guide indexed for this repository

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 at the stash view and inspect the staging and unstaging actions, including the ? help output. Trace how staging a file and hunk is handled, then define the supported behavior for stash changes and update the help text so the completed behavior matches it.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.