Skip to content

WIP: 23797 git manage ignore files - #25718

Closed
Naveen Kumar (timbanaveen) wants to merge 2 commits into
microsoft:masterfrom
timbanaveen:23797-git-manage-ignore-files
Closed

Naveen Kumar (timbanaveen) wants to merge 2 commits into
microsoft:masterfrom
timbanaveen:23797-git-manage-ignore-files

Conversation

@timbanaveen

@timbanaveen Naveen Kumar (timbanaveen) commented May 1, 2017 •

Copy link
Copy Markdown

Fix for #23797

  • Ability to ignore selected file from source control view.
  • Ability to ignore all selected files from source control view.
  • (Proposal) Ability to ignore files of same extension as per selected file in source control view Example: (ignore all *.txt files).

@mention-bot

Copy link
Copy Markdown

Naveen Kumar (@timbanaveen), thanks for your PR! By analyzing the history of the files in this pull request, we identified João Moreno (@joaomoreno) and Johannes Rieken (@jrieken) to be potential reviewers.

@msftclas

Naveen Kumar (@timbanaveen),
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@timbanaveen

Copy link
Copy Markdown
Author

Hi João Moreno (@joaomoreno),
Need help in writing tests for this case. Requirement to test this case is:

  1. Having git repo and have some modified files in there.
  2. Add some files in .gitignore and check if it is present in modified list.

Is it possible to have test for this use cases ?
Thanks

@joaomoreno João Moreno (joaomoreno) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's move the updating of the .gitignore file to go through the vscode applyEdit API instead of directly writing to disk.

return true;
}

export async function createOrAppendFile(path: string, data: string, options?: any): Promise<boolean> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd rather we go through the applyEdit vscode API, instead of raw node file editing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi João Moreno (@joaomoreno)
I tried with applyEdit API, applyEdit have following behavior

  • opens .gitignore file and append data (without saving).
  • If file is not present, there is an error, i am not able to find file creation API in case we want to create file.
  • I thought we are going to create or append file silently, but above API uses worksapce hence it opens file first and then edit it. Also we need to have some mechanism to save this particular file while editing. I found saveAll method but not save method.

please guide.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Opening the file is the right thing to do. I want to user to be aware of what is happening. We should show him what is being done behind the scenes here. If the user has auto-save enabled, the file should be automatically saved, right Benjamin Pasero (@bpasero)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, any change to the model is changed automatically if auto save is enabled. We open the file automatically in the background if a model becomes dirty and was not opened yet.

@jrieken

Copy link
Copy Markdown
Contributor

fyi - you can also add commands the explorer with the explorer/context menu. with that you can ignore whole folders

@BuraChuhadar

Copy link
Copy Markdown
Contributor

Naveen Kumar (@timbanaveen) are you still working on this? If you don't, can I take a look?

@timbanaveen

Copy link
Copy Markdown
Author

bugrac , I am waiting for João Moreno (@joaomoreno) , actually needed some more information regrading VS APIs.
But, sure you can go ahead and work on this. :)

@BuraChuhadar

Bura Chuhadar (BuraChuhadar) commented Jun 22, 2017 •

Copy link
Copy Markdown
Contributor

João Moreno (@joaomoreno) I added the apply edit API here: #29243 on top of these changes. Please let me know if that works.

@joaomoreno

Copy link
Copy Markdown
Contributor

Closing in favour of #29243, which contains these changes.

@roblourens roblourens removed this from the June 2017 milestone Jun 30, 2017
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants