Comments (8)
Very strange. It's working fine for me:
fboender @ jib ~/Projects/fboender/test_gogs (master) $ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
fboender @ jib ~/Projects/fboender $ mgitstatus test_gogs/ 1
test_gogs/: Needs pull (master)
It might have something to do with that extra info in your git status
output (the ✔ ~/repo/nagios [master ↓·3|✔]
).
On line 25 of the mgitstatus
script, there's a DEBUG=0
line. Can you try changing that to DEBUG=1
and pasting the output here?
from multi-git-status.
Different Repo but same git style
/Users/drahamim/repo/ansible-playbooks
CNT_AHEAD_BEHIND: 0 0
CNT_AHEAD: 0
CNT_BEHIND: 0
REV_LOCAL: a759ec538acdfa82296fb6658c87fedf202d0a58
REV_REMOTE: a759ec538acdfa82296fb6658c87fedf202d0a58
REV_BASE: a759ec538acdfa82296fb6658c87fedf202d0a58
/Users/drahamim/repo/ansible-playbooks: ok
✔ ~
14:25 $ cd repo/ansible-playbooks/
✔ ~/repo/ansible-playbooks [master|✔]
14:26 $ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
✔ ~/repo/ansible-playbooks [master ↓·1|✔]
14:26 $ repostat
~/repo/ansible-playbooks
CNT_AHEAD_BEHIND: 0 1
CNT_AHEAD: 0
CNT_BEHIND: 1
REV_LOCAL: a759ec538acdfa82296fb6658c87fedf202d0a58
REV_REMOTE: 5b3e3ed4d57a7522b2f5ad282e1cbe28e85ad416
REV_BASE: a759ec538acdfa82296fb6658c87fedf202d0a58
~/repo/ansible-playbooks: Needs pull (master)
✔ ~/repo/ansible-playbooks [master ↓·1|✔]
14:27 $
from multi-git-status.
It looks as though an automatic "git fetch" is being done somewhere.
When you change into the directory, there are no changes according to your prompt. After having run git status
, there's suddenly a new commit:
$ cd repo/ansible-playbooks/
✔ ~/repo/ansible-playbooks [master|✔]
# git status executed here
✔ ~/repo/ansible-playbooks [master ↓·1|✔]
I think this might be the problem. mgitstatus doesn't do a "git fetch" on repos, so it doesn't know about the latest remote changes. Apparently your git does a "git fetch" when you run "git status", so as soon as you do so, new remote commits become visible and mgitstatus output changes.
This could either be default behaviour in newer versions of git (my version doesn't do it), or your "git status" command might have been aliased to "git fetch && git status" in your ~/.gitrc or something.
from multi-git-status.
I've implemented an argument (-f
) that performs a "git fetch" on each repo before showing the status. This should mimic your setup more closely. Can you check to see if specifying the "-f" option makes the weirdness disappear?
from multi-git-status.
/Users/drahamim/repo/nagios: ok
/Users/drahamim/repo/multi-git-status: ok
✔ ~
13:43 $ cd repo/nagios/
✔ ~/repo/nagios [master|✔]
13:43 $ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
✔ ~/repo/nagios [master ↓·1|✔]
13:43 $ repostat
/Users/drahamim/repo/nagios: Needs pull (master)
/Users/drahamim/repo/multi-git-status: ok
✔ ~/repo/nagios [master ↓·1|✔]
13:43 $ cat ~/.bash_profile |grep repostat
./repostat ~/repo 1 -f
alias repostat="~/repostat ~/repo 1 -f"
✔ ~/repo/nagios [master ↓·1|✔]
13:44 $ ls -al ~/repostat
lrwxr-xr-x 1 drahamim staff 32 Oct 29 09:20 /Users/drahamim/repostat -> repo/multi-git-status/mgitstatus
✔ ~/repo/nagios [master ↓·1|✔]
from multi-git-status.
alias repostat="~/repostat ~/repo 1 -f"
The order here is wrong. This shouldn't even be working. Can you try without the aliases, bash plugins, etc? It's only confusing things. Update to the latest version of multi-git-status (git pull --rebase
in the repo) and then run:
$ bash --noprofile --norc
$ /Users/drahamim/repo/multi-git-status -f /Users/drahamim/repo/
from multi-git-status.
When testing the way you provided above it does execute fetch correctly.
This is the git version I have
git --version
git version 2.17.1 (Apple Git-112)```
from multi-git-status.
Okay, so it seems the problem isn't with multi-git-status, but rather with your git setup. This confirms that:
$ cd repo/ansible-playbooks/
✔ ~/repo/ansible-playbooks [master|✔]
$ git status
....
✔ ~/repo/ansible-playbooks [master ↓·1|✔]
You've probably got a git alias in ~/.gitconfig
or a shell alias in ~/.bashrc
that does a git fetch
whenever you do a git status
, which is why the new commits are suddenly showing up after running git status
.
The easiest thing to do is to keep using the -f
option of mgitstatus so that output will be consistent with manually doing git status
in your repos.
from multi-git-status.
Related Issues (20)
- "backing up" a git tree HOT 1
- syntax examples out of sync HOT 1
- targeting git repos with a nonstandard name/path? HOT 4
- [Question]/suggestion: Auto add to your path? or dot file? HOT 2
- flag remote branches that are ahead of remote master HOT 3
- branches in .git/logs/refs/heads are not checked, but do show up as branches in git-branch HOT 1
- Can we get a new release? HOT 1
- Repositories under 2 levels deep of a regular folder are not checked HOT 2
- Composer install HOT 2
- Suggestions to improve packaging of mgitstatus HOT 6
- Not installing (macOS Big Sur) HOT 4
- "No commits yet" reported as "Uncommitted changes" HOT 3
- Got blocked out of server because queries happened too quickly HOT 2
- Very nice tool; thanks HOT 1
- Very slow lately HOT 3
- Install error on M1 macOS Monterey 12.3.1 (21E258) HOT 1
- Fork changes undetected HOT 4
- "find: ./.Trash: operation not permitted" appearing when run in home folder HOT 3
- Add a flag to list branches
- A "no" depth option HOT 2
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 multi-git-status.