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

Do not show outdated unstaged/staged information during branch or repo changes #166

Open
chrispy-snps opened this issue May 19, 2022 · 6 comments

Comments

@chrispy-snps
Copy link

chrispy-snps commented May 19, 2022

Currently, when the Git add-on switches from one branch to another, or one repository to another, the old unstaged/staged file information is shown until the new information is refreshed. For our repos (which are large), the old information can be shown for 5-15 seconds or more.

In fact, the motivation for this enhancement request was that it took long enough that a writer sent me a message asking about the outdated information, and I replied that it should be updated shortly. (She replied that she was impressed I could predict the future!)

This enhancement requests that the outdated unstaged/staged information be ghosted/grayed or replaced with a "busy" indicator (as the DITA Maps Manager uses) until the new information is displayed when the branch or working copy is changed. (Blanked sections alone imply no unstaged/staged changes, which could be incorrect.)

A testcase is included (requires Perl and command-line Git):

make_testcase.zip

To run it,

  1. Run the following script:

    ./make_testcase.pl

    This creates the following repo directories:

    repo1-abcdefg
    repo2-UVWXYZ
    
  2. Open the OPENME.xpr file in each directory so that the projects are known to Oxygen.

  3. Switch between the projects and note that for a duration, old information is displayed under the new project/repo name.

git_addon_switching_delay

You can edit the script to create more files to induce a larger delay.

A contributing factor is the time it takes to retrieve updates from upstream, which this testcase also cannot reproduce. This is especially significant when switching to a repo that hasn't been used for some time, and there is a lot of information to fetch.

One additional note - sometimes the Git add-on never notices when I've switched projects in Oxygen, even after I've highlighted the add-on's view to wake it up.

@chrispy-snps chrispy-snps changed the title Do not show outdated branch/unstaged/staged information during a working copy switch Do not show outdated branch/unstaged/staged information during branch or repo changes May 19, 2022
@chrispy-snps chrispy-snps changed the title Do not show outdated branch/unstaged/staged information during branch or repo changes Do not show outdated unstaged/staged information during branch or repo changes May 19, 2022
@kirkilj
Copy link

kirkilj commented May 20, 2022

I've seen the same behavior many times myself, and I kept meaning to mention it.

@AlexJitianu
Copy link
Collaborator

One additional note - sometimes the Git add-on never notices when I've switched projects in Oxygen, even after I've highlighted the add-on's view to wake it up.
Are the projects located in the same directory? After looking at the code, I think this is one case in which project switch detection might fail.

@chrispy-snps
Copy link
Author

@kirkilj - thanks for sharing your observations! Have you noticed the delay/outdated information issue, the failure-to-notice-the-switch issue, or both?

@AlexJitianu - they are in separate peer directories, like this:

dita-digital/snps_books.xpr
dita-ams/snps_books.xpr
dita-seg/snps_books.xpr

The failure-to-notice-the-switch issue doesn't happen regularly, but it does happen. Or maybe it's just really busy doing something, I normally forcibly open the repo after waiting 30 seconds or so.

@chrispy-snps
Copy link
Author

Also, it would be good for the Git add-on to show the ghosted/in-progress indicator during the initial update when you first run Oxygen then open the Git Staging view. Currently, it is blank until the update completes, but I don't know if that means I had no work outstanding last time, or if it's busy fetching updates upstream and updating locally.

@kirkilj
Copy link

kirkilj commented May 20, 2022

@AlexJitianu, I have noticed both issues. The delay happens quite frequently. The project view updates quickly, but it could take 5 to 20 seconds for the Git views to catch-up. At a minimum, a progress indicator in the affected views would help. Another angle might be a preference for sync or async updates of git views on project switch.

A few times I've gotten the updates are available to pull dialog a few seconds after I've switched away to a different project.

The not switching at all is much more rare. I'll make note of the use case the next time it happens.

@sorincarbunaru
Copy link
Collaborator

Note: internal issue ID is EXM-52759.

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

No branches or pull requests

4 participants