Comments (11)
Same problem here...
from git-radar.
Don't think I have the same problem with local untracked branches, but I did see this same error message yesterday when I made a new github repo.
I created the repo on github (repo is empty, no readme etc), I then cloned it. When I enter the repo this message appears, and continues to appear until I have pushed something.
Same similar in that it would be untracked until pushing, but I seem to only see it for new repos.
I am on Ubuntu
from git-radar.
I think I have pinpointed my problem, and perhaps it is similar for everyone else...
in radar-base.sh there are two git commands that cause my error to come up which are:
git rev-list --right-only --count ${remote_branch}...HEAD
git rev-list --left-only --count ${remote_branch}...HEAD
This command lists the commit objects in reverse chronological order...
The first one (right only) lists the commit objects in reverse order of HEAD in this case, and --left-only does the same but for whatever my ${remote_branch} happens to be... in this case, origin/master
I am guessing the error is because there are no objects in a new repo.
So if we are going to fix this, probably will need a check on the git commands to make sure there is actually something to read, or force an ignore of the error messages...
I noticed in some functions nearby that similar calls are appended by "2>/dev/null || printf '%s' "0""... If we do the same, this will probably go away (for me at least).
Maybe you can check if these are the same calls that are causing problems for you?
What also seems weird about the output you have provided is that the branch it displays is "./master...HEAD"... I have not seen a ./ in a branch before so this could be something else.
Question for the owner: is there a reason that the two calls mentioned above (in functions: commits_ahead_of_remote and commits_behind_of_remote) do not have 2>/dev/null appended, or is this something we can add easily (Just wondering if there is any actual reason that we would not want to add this).
NOTE: I tried appending the 2>/dev/null etc to those two lines mentioned, and the problem does go away for me
from git-radar.
Yep, I think @hallzy has it. An empty repo causes this problem. Appending 2>/dev/null
fixes.
@thomasdziedzic It should also fix your problem, though the remote reference seems screwy. Can you run the following commands:
> git config --get "branch. some-branch.merge"
> git config --get "branch. some-branch.remote"
(assuming your branch is called some-branch
)
You should see ref/heads/some-branch
as the merge and origin
as the remote. If they aren't like that then that might be what's going on. Either a bad sed on git-radars part or a misconfigured remote on your repo?
from git-radar.
@michaeldfallen looks like the issue for me might be a misconfigured remote
both of the commands don't print out anything
$ git config --get "branch. some-branch.merge"
$ git config --get "branch. some-branch.remote"
do you have suggestions on how to fix this?
$ git remote -v
origin [email protected]:Org/repo.git (fetch)
origin [email protected]:Org/repo.git (push)
looks correct to me
from git-radar.
@hallzy Your fix also solves #88 but in a seemingly error-squashing way. I am trying to figure out if I would like to be notified if one of my tracked branches gets deleted, and burying the error in the bitbucket doesn't leave much room for options there. Adding a check for tracked branches' existence and adding more emoji would be cool. 🎉🎊🐬🐳
This is totally up to @michaeldfallen, and I admit the consideration for error handling within a small utility like this may be overkill. radar-base.sh
already uses /dev/null
in several places (git grep -e \/dev\/null
), so I am a-OK with closing #88 if the error is just buried.
@thomasdziedzic There should be no space between branch.
and the branch name. You can also take a look inside your repository's .git/config
file to see how each branch is setup. This is what your some-branch
configuration should look like on a remote that is not misconfigured according to @michaeldfallen's comment:
[branch "some-branch"]
remote = origin
merge = refs/heads/some-branch
This function is responsible for retrieving remote branch information and fetches the remote information from your git configuration. Misconfigured branches would cause odd behavior in there.
from git-radar.
I got the following:
$ git checkout -b some-branch
Branch some-branch set up to track local branch master.
Switched to a new branch 'some-branch'
$ git config --get "branch.some-branch.merge"
refs/heads/master
$ git config --get "branch.some-branch.remote"
.
from git-radar.
@thomasdziedzic sorry about that, I added a space by accident. Yeah that remote config doesn't look right. it should be a name of a remote. Not entirely sure how we fix this. Can you check that the branches are properly configured when you clone a different repo and run git checkout -b new-branch; git push -u origin new-branch
?
from git-radar.
@colinsf nice catch with the extra space. My mistake 😞.
from git-radar.
@colinsf the "missing remote branch" indicator you mentioned is interesting. We have the upstream ⚡my-branch
to do just that but it only seems to care if its not "set upstream". I suppose rather than squashing the error outputting that would be more informative to the user?
from git-radar.
"Interesting" is about where I left off thinking about it as well. Maybe throw it into a future feature?
from git-radar.
Related Issues (20)
- is_cwd_a_dot_git_directory:1: = not found HOT 7
- Promote new Maintainers HOT 4
- Calling Formula.sha1 is deprecated! HOT 4
- Calling Formula.sha1 is deprecated! HOT 2
- Not upstream indicator taking up too much space HOT 12
- problem with fish HOT 2
- Weird issue with Makefile HOT 2
- Running git-radar --bash is slow HOT 3
- Fish - LS is completely bugged HOT 2
- command overlaps prompt with stash HOT 1
- odd sed error on branches named with multiple / characters HOT 7
- have to pull twice to update a work branch HOT 22
- Made a new lightweight stable version of git-radar HOT 2
- weird characters show up with git-radar on mac os x HOT 8
- Unhandled git error when a tracked upstream branch is removed HOT 2
- 0.6 upgrade issue HOT 3
- feature req: color prompt red when folder not writable HOT 1
- Reduce the number of binaries needed to be added to the path HOT 3
- cd .git/ produces fatal: /usr/lib/git-core/git-stash cannot be used without a working tree HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-radar.