Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of status changes by git plugin when file content changes #2265

Closed
wants to merge 9 commits into from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jul 20, 2023

Partially fixes #2261

  • Fix how git plugin handles update_file_info - update git status for single file
  • Emblem on new files in working directory as well as index
  • Ensure update_file_info is called for file changes
  • Ensure update_file_info called for file-added events even if file already in cache
  • Ignore transient outputstream files so they do not trigger calls to update_file_info

Jeremy Wootten added 5 commits July 20, 2023 17:22
* Always get status list
* Handle Git status INDEX_NEW
* Call plugins.update_file_info when needed
* Allow updating status map for single file
* Correct error in lookup status
* Use same status_options as Code
* Ignore folders
* Handle thrown error
@danirabbit
Copy link
Member

@jeremypw can you resolve conflicts here?

# Conflicts resolved in:
#	src/View/AbstractDirectoryView.vala
@jeremypw jeremypw marked this pull request as draft August 15, 2023 10:48
@jeremypw
Copy link
Collaborator Author

Linked issue not fixed after merging main - investigating.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Aug 15, 2023

So, it looks like this never solved the entire issue. It only solves the case where the file content changes, so the emblem will change to "modified" when there are uncommitted changes and is removed if the uncommitted changes are reverted. New untracked files will get the appropriate emblem when they appear.

However, the emblem does not change automatically when there is a commit made. This is because the file itself does not change - it is the git database that changes. The Code application does detect this because it monitors the .git folder of the active project. It would add significant complication to Files to do this as it is not project-centric. It may be necessary to promote the git plugin to main code like in Code.

Not sure if this partial fix is still worth merging or whether to try for a full fix.

@jeremypw jeremypw marked this pull request as ready for review August 15, 2023 11:35
@jeremypw jeremypw changed the title Fix handling of status changes by git plugin Fix handling of status changes by git plugin when file content changes Aug 15, 2023
@jeremypw jeremypw marked this pull request as draft January 14, 2024 14:49
@jeremypw
Copy link
Collaborator Author

Closing as not complete fix and no reviews

@jeremypw jeremypw closed this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changes to git status not reflected in view until view refreshed
2 participants