Skip to content

Support staging for new files#78562

Merged
joaomoreno merged 2 commits intomicrosoft:masterfrom
OneThatWalks:stageuntrackedrange
Aug 12, 2019
Merged

Support staging for new files#78562
joaomoreno merged 2 commits intomicrosoft:masterfrom
OneThatWalks:stageuntrackedrange

Conversation

@OneThatWalks
Copy link
Contributor

Addresses #78046

@joaomoreno the real 'fix' or 'feature' was adding the --add arg to the update-index when an error was thrown by getObjectDetails(). This may not be the best way to go about this, but I recorded the behavior for this PR. The diff editor was utilized to get the context menu items to show up.

stagechanges

@msftclas
Copy link

msftclas commented Aug 6, 2019

CLA assistant check
All CLA requirements met.

@octref octref requested a review from joaomoreno August 6, 2019 16:34
@joaomoreno joaomoreno added the git GIT issues label Aug 7, 2019
@joaomoreno joaomoreno added this to the Backlog milestone Aug 7, 2019
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two problems I see:

  • When staging from untracked, the left hand side does not update at all.
  • When having a file half untracked, half staged, the left hand side of the untracked makes no sense, it has repeated lines

@OneThatWalks
Copy link
Contributor Author

Two problems I see:

* When staging from untracked, the left hand side does not update at all.

* When having a file half untracked, half staged, the left hand side of the untracked makes no sense, it has repeated lines

I'll do some digging here. I was wondering if the diff editor made sense to even use? At least for untracked files.

@joaomoreno
Copy link
Member

I think it still does:

  • For untracked files: on the left we should see the "index" version of the file: everything that is already staged.
  • For index added files: on the left we should always see an empty document.

@OneThatWalks
Copy link
Contributor Author

It looked like my git uri ref was incorrect for "untracked" files. I recorded the cases above working correctly.

The left side of an untracked file shows the staged changes, the contents update and make sense with the untracked changes.

The left side of a index add is always blank, and is updated on range stage changes.

stagechanges2

@joaomoreno joaomoreno merged commit 74a0865 into microsoft:master Aug 12, 2019
@joaomoreno
Copy link
Member

Excellent, great fix! I've added a check for the thrown error to make sure we only catch that specific error. And debugging this actually made me catch another issue: #78949

Thanks! 🍻

@joaomoreno joaomoreno modified the milestones: Backlog, August 2019 Aug 12, 2019
@rawtaz
Copy link

rawtaz commented Aug 12, 2019

Seriously quick work by you guys, fixing the original issue so quickly. Really nice!

@OneThatWalks OneThatWalks deleted the stageuntrackedrange branch August 12, 2019 13:04
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants