News for hackers. Stuff that matters.
Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by masklinn on Saturday February 19, 2022 @01:53PM (#30399466)
> You do that with a sequence of "git add -p" and "git commit" commands.

You can do that with git commit -p.

Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by bonzini on Saturday February 19, 2022 @02:34PM (#30399789)
True but there's usually a "git diff --staged" in the middle to check what I am committing.
Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by masklinn on Sunday February 20, 2022 @02:19AM (#30403886)
You can do that with “git show HEAD” (and “git commit --amend -p”).
Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by cryptonector on Sunday February 20, 2022 @11:34PM (#30412011)
`git diff --staged` is superior. For one, you get all the options to `git diff`. For another, it has no side effects, unlike `git commit --amend -p`.
Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by masklinn on Monday February 21, 2022 @03:46AM (#30413362)
> `git diff --staged` is superior. For one, you get all the options to `git diff`.

Most of which you can get on git show at least if they're relevant to “what have I added”. And of course you can also use git diff on commits if you need something super specific.

> For another, it has no side effects, unlike `git commit --amend -p`.

… “git commit --amend -p” is the replacement for subsequent “git add -p”, as the GP was talking about a workfliw where they’d intersperse staging stuff and looking at what they’d staged.

Re:Jujutsu – A Git-compatible DVCS that is both simple and p... by cryptonector on Saturday February 19, 2022 @03:58PM (#30400477)
Exactly!