oxygen-git-client-addon icon indicating copy to clipboard operation
oxygen-git-client-addon copied to clipboard

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

Open chrispy-snps opened this issue 2 years ago • 6 comments

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 avatar May 19 '22 16:05 chrispy-snps

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

kirkilj avatar May 20 '22 02:05 kirkilj

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.

AlexJitianu avatar May 20 '22 13:05 AlexJitianu

@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 avatar May 20 '22 13:05 chrispy-snps

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.

chrispy-snps avatar May 20 '22 14:05 chrispy-snps

@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.

kirkilj avatar May 20 '22 20:05 kirkilj

Note: internal issue ID is EXM-52759.

sorincarbunaru avatar Mar 07 '23 10:03 sorincarbunaru