NeogitOrg / NeogitOrg/neogit

Add a keybinding for 'git add --intent-to-add' ('git add -D')

Open
#520 20 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
5.6k
Forks
357
Avg merge
15h 47m
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.

image

Sometimes I want to see a diff in Neogit for a file that hasn't been added yet. The only way to do it inside Neogit is by staging it (pressing s).

Describe the solution you'd like

The git add command supports the flag --intent-to-add (docs here). Neogit could support it with a top-level keybinding for the NeogitStatus buffer, for example i.

Pressing i would run git add --intent-to-add <file-under-cursor> and result in this:

image

Note that the file is in the Unstaged area.

Describe alternatives you've considered

Run git add --intent-to-add <file-under-cursor> in the CLI. Defeats the purpose of Neogit.

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 at the NeogitStatus buffer's top-level keybinding definitions and trace how the file under the cursor is passed to Git commands. Add the requested intent-to-add action and verify that pressing the binding runs git add --intent-to-add <file> while leaving the file in the Unstaged area.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, lua, neovim
Domain
cli, devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.