romkatv / romkatv/gitstatus

Negative fetch refspec breaks gitstatus

Open
#438 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.8k
Forks
134
Avg merge
2d 18h
Merged PRs (30d)
1

Description

My CI pushes some generate files to <current branch/tag>-deploy branches/tags. Usually I don't want to fetch them, so I added two negative fetch refspecs:

[remote "origin"]
	url = https://github.com/Frederick888/playground.git
	pushurl = git@github.com:Frederick888/playground.git
	fetch = +refs/heads/*:refs/remotes/origin/*
	fetch = ^refs/heads/*-deploy
	fetch = ^refs/tags/*-deploy
	tagOpt = --tags
	gh-resolved = base

This breaks gitstatus.

For example, git clone https://github.com/Frederick888/playground.git; cd playground; git reset --hard HEAD~, then without the negative refspecs, the response is:

'id'
'1'
'/Users/frederick/programming/Others/playground'
'b46755b65173bbc9733356ec8a7a8c0214f33910'
'master'
'master'
'origin'
'https://github.com/Frederick888/playground.git'
''
'16'
'0'
'0'
'0'
'0'
'0'
'1'
'0'
''
'0'
'0'
'0'
'origin'
'https://github.com/Frederick888/playground.git'
'0'
'1'
'0'
'0'
''
'Commit 2 on master'

With the negative refspecs, the response is:

'id'
'1'
'/Users/frederick/programming/Others/playground'
'b46755b65173bbc9733356ec8a7a8c0214f33910'
'master'
''
''
''
''
'16'
'0'
'0'
'0'
'0'
'0'
'0'
'0'
''
'0'
'0'
'0'
''
''
'0'
'0'
'0'
'0'
''
'Commit 2 on master'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported gitstatus output in a cloned repository with and without the two negative fetch refspecs, using the configuration shown in the issue. Trace how gitstatus reads branch and remote information, then verify that the reported metadata remains available when those refspecs are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, git
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.