Github: Git tab stays empty when adding a git project and then toggling the Git tab

Created on 4 Oct 2018  Â·  17Comments  Â·  Source: atom/github

Prerequisites

✅

Description

Split out from https://github.com/atom/github/issues/1566#issuecomment-420759016: if you open a git project and then toggle the Git tab before opening a file, the Git tab stays empty even after you click on a project file. Toggling it off and on doesn't make it active but if you explicitly close it and then toggle it on, it starts working.

Steps to Reproduce

Start Atom in safe mode and then:

  1. Add a Git project with Application: Add Project Folder
  2. Toggle the Git tab with GitHub: Toggle Git Tab
  3. Double click on one of the project files

The project opened needs to have no files open from saved state, otherwise things work fine.

Expected behavior:

Expect to see the Git tab UI.

Actual behavior:

See a blank Git tab. In 1.29, the Git tab UI showed after step (2).

GIF-age-ment:

empty-git-tab

Reproduces how often:

100%

Versions

Looks like this started in 1.30 and also reproduces in Atom 1.33.0-nightly7.

macOS 10.12.6

bug papercut triaged

Most helpful comment

A variation on this that I run into literally every day:

  1. Have Atom set to begin with a blank session instead of automatically reopening any projects. (I did this to work around some hang issues in Atom itself...)
  2. Reopen the most recent project from the File menu.
  3. If your previous session had the Git tab open, the tab starts out open... with nothing in it, no content, no panes. Closing and reopening has no effect.
  4. Close the Git tab, then close Atom. Repeat 1-3. Now the Git tab starts closed, and when you open it, has the expected information and layout.

All 17 comments

I ran into this yesterday on Windows with a very recent Atom build and 0.19.1-3.

A variation on this that I run into literally every day:

  1. Have Atom set to begin with a blank session instead of automatically reopening any projects. (I did this to work around some hang issues in Atom itself...)
  2. Reopen the most recent project from the File menu.
  3. If your previous session had the Git tab open, the tab starts out open... with nothing in it, no content, no panes. Closing and reopening has no effect.
  4. Close the Git tab, then close Atom. Repeat 1-3. Now the Git tab starts closed, and when you open it, has the expected information and layout.

Just like @SabreCat describes, I have been having the same issue since release 1.30.0 every single day, with every project.

Thank for the work-around! This has been frustrating me for months!

Still present in 1.34.0.

My variation starts the same as yours, with the following difference:

3a. Clicking any root-level project file triggers the correct git pane display.
3b. Clicking any non-root-level project files empties the git pane again.

I just started using Atom and this was driving me crazy, I couldn't figure out why I was unable to get Github to work at all within Atom; just blank. Thank you @SabreCat for the workaround!

Workaround works on both Mac and Windows and 1.35.1 still has the problem on both.

Thanks!

Found another condition where git tab fails:

  1. Start with Atom and Git Tab functioning as expected.
  2. Set Atom to be your Git editor with git config --global core.editor "atom --wait".
  3. git merge one branch to another.
  4. Atom will open the git merge message in a new tab in that project.
  5. git tab will now be in a broken state, where some files show a correct tab and some files show the "create a repository" tab.

Thanks @SabreCat. Your solution worked for me too (Atom 1.36.1 on Mac).

I'm no longer seeing this in Atom 1.37.0.

I'm still seeing this on 1.41.0 (on MacOS anyways)

Back for me as well on 1.41.0 MacOS.

also seeing this in macOS 10.14.6
image

Steps to Reproduce

One atom editor window open on project tracked in git
Other projects in history
File -> New Window
File -> Reopen Project, on project that had git tab previously closed

Versions

Atom    : 1.41.0
Electron: 4.2.7
Chrome  : 69.0.3497.128
Node    : 10.11.0
apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.41.0
python 2.7.16
git 2.24.0

I was going to submit a new bug report
please fix this

The problem @wesinator describe I have now nice very long, and on all platform: Linux (fedora), MacOS and Windows.

Same here:

% atom --version
Atom    : 1.48.0
Electron: 5.0.13
Chrome  : 73.0.3683.121
Node    : 12.0.0

% apm --version
apm  2.5.0
npm  6.14.5
node 10.20.1 x64
atom 1.48.0
python 2.7.16
git 2.24.0

Interestingly I noticed that when this happens, if I try to quit Atom it actually hangs and I need to do Force Quit on Mac - seems like some command is hanging in the background?
This is happening for me very frequently, a couple of times a day, quite irritating.

Ok, so I just ran into this problem too. This is how it happened and how I fixed it:

I had just done a fresh install of Ubuntu 20.04. I use docker containers as my development environment, using docker-compose. In docker-compose.yml, I've configured ~/.gitconfig and ~/.gitignore as volumes for my workspace containers to sync git settings between them and the host. Because it takes a while the first time, I ran docker-compose up and only then installed Atom. After installing some packages, I opened the first project and noticed that git tab not showing commits/diffs, while the tree view did give the files their appropriate colours.

Only after a while I realized that I hadn't configured git yet. And as a result of that, docker-compose had made the ~/.gitconfigand~/.gitignoreinto root-owned folders instead of user owned files. After closing Atom and runningdocker-compose down, I deleted those folders and configured git, resulting in ~/.gitconfig and ~/.gitignore being user-owned files, as they should. After that, the git tab in Atom worked just fine.

TL;DR For me, this seems to have happened because ~/.gitconfigand~/.gitignore` where folders instead of files, resulting in git not being able to read it's config.

I just found a way to reproduce it consistently in my case:

Scenario 1 (always failing):

  • make sure that Atom is not running
  • start Atom with with a project that has Git setup properly - the Git tab will be working fine
  • now, close Atom window - not with Ctrl+Q, but with the red dot on mac window bar
  • you'll notice that when the window is closed, Atom is still running in the background
  • click the Atom icon again, an empty project opens up
  • File > Reopen project - select the previous project - Git tab is empty

Scenario 2 (always passing):

  • exactly the same steps as in scenario 1, but use Ctrl+Q (quit atom instead of only the window)

To note:
sometimes I even cannot do Ctrl+Q (or Quit) as it has no effect and have to forcibly close Atom.

Running into the same issue on Ubuntu 20.20.
Git functionality was working fine, then clicked 'stage all' and no buttons worked after that.
Removed the .atom directory to reset to default and the git tab went blank. However, the left pane still showed colored filenames, so it appeared to be interpreting the git file status.

I checked file permissions in the .git directory as someone above had mentioned, but found no issues.
I used the command line to commit and push my changes, deleted the repo directory, then removed the project folder from Atom, closed all tabs and exited.
Then I re-cloned my code from the Git repo, started Atom, and added the project folder. This time it seemed to be working correctly.
Judging by the way this played out, it looks like maybe an invalid state is getting written to the git directory and causing an error? Since clearing Atom's directory did nothing, and wiping out and re-cloning the repo fixed the issue.

Atom : 1.48.0 Electron: 5.0.13 Chrome : 73.0.3683.121 Node : 12.0.0 apm 2.5.0 npm 6.14.5 node 10.20.1 x64 atom 1.48.0 python 2.7.18rc1 git 2.25.1

I just found a way to reproduce it consistently in my case:

Scenario 1 (always failing):

  • make sure that Atom is not running
  • start Atom with with a project that has Git setup properly - the Git tab will be working fine
  • now, close Atom _window_ - not with Ctrl+Q, but with the red dot on mac window bar
  • you'll notice that when the window is closed, Atom is still running in the background
  • click the Atom icon again, an empty project opens up
  • File > Reopen project - select the previous project - Git tab is empty

Scenario 2 (always passing):

  • exactly the same steps as in scenario 1, but use Ctrl+Q (quit atom instead of only the window)

To note:
sometimes I even cannot do Ctrl+Q (or Quit) as it has no effect and have to forcibly close Atom.

I have been experiencing this issue as well, reproducible with those steps.

However, after the last Atom update (1.53.0), the issue seems to have changed: Instead of showing a blank git panel, it shows a git panel asking for the Git Identity (username and email), but with the fields already filled in. Clicking on "Continue" then shows the proper git panel.

atom --version:

Atom    : 1.53.0
Electron: 6.1.12
Chrome  : 76.0.3809.146
Node    : 12.4.0

apm --version:

apm  2.5.2
npm  6.14.8
node 12.4.0 x64
atom 1.53.0
python 2.7.16
git 2.24.3

Running on macOS Catalina 10.15.7.

Was this page helpful?
0 / 5 - 0 ratings