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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when git status buffer is open in a repo on a branch without an upstream #48

Closed
akinsho opened this issue Mar 1, 2021 · 1 comment 路 Fixed by #72
Closed

Errors when git status buffer is open in a repo on a branch without an upstream #48

akinsho opened this issue Mar 1, 2021 · 1 comment 路 Fixed by #72
Labels
bug Something isn't working

Comments

@akinsho
Copy link
Contributor

akinsho commented Mar 1, 2021

Thanks for your work on this plugin 馃殌 I'm really excited to see where things go 馃挴 .

I just wanted to note a bug I encountered whilst using it (I appreciate it's WIP but thought you might want to have this tracked). When calling NeogitStatus whilst on a branch without an upstream I get repeated command error popups. Looking at the log via $ I see

 128 git log --oneline @{upstream}.. --
  | fatal: no upstream configured for branch 'feature/multiple-carer-notes'
 128 git log --oneline ..@{upstream} --
  | fatal: no upstream configured for branch 'feature/multiple-carer-notes'
  0 git log --max-count=1 --pretty=%B --
  | fix: refetch the token for every request
  | 
  | This prevents it going out of sync when logging out and in to the app as
  | different users
 128 git log --max-count=1 --pretty=%B @{upstream} --
  | fatal: no upstream configured for branch 'feature/multiple-carer-notes'
  0 git status --porcelain=1 -b --
  | ## feature/multiple-carer-notes
  |  M lib/services/api.dart

When I run the erroring commands in a terminal it prints

git log --oneline ..@{upstream}.. --
fatal: no upstream configured for branch 'feature/multiple-carer-notes'

I wonder if there should be a check for if there is a valid upstream before upstream related commands are tried? not sure the best way round this based on how this plugin is structured but in this case I don't really think this is a real error in this case since it's expected as I just created the branch and haven't pushed it yet

EDIT: also not sure if it's intended but -- is being appended to all commands it looks like without any further arguments not sure if that's intentional or not

RianFuro added a commit that referenced this issue Mar 1, 2021
Fix a regression from ff7c7ad
Calls resulting from synchronizing git status no longer cause popups to
show if any of the commands fail.
@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

Hi, thanks for the issue!
I've band-aided the problem, so the upstream calls don't raise the errors as popups anymore; but you're right of course, we shouldn't issue those commands in the first place if there's no upstream - so I'll keep the issue open.

Regarding the -- in the commands: Those just separate the pathspec from regular arguments in git commands. They are usually not needed and afaik have no impact on the overall command even if there's no pathspec following them, but the builder just always appends them since it's easier and safer to just do it.

@TimUntersberger TimUntersberger added the bug Something isn't working label Mar 23, 2021
@akinsho akinsho mentioned this issue Mar 31, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants