GithubHelp home page GithubHelp logo

Comments (8)

fboender avatar fboender commented on August 30, 2024

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.

drahamim avatar drahamim commented on August 30, 2024

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.

fboender avatar fboender commented on August 30, 2024

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.

fboender avatar fboender commented on August 30, 2024

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.

drahamim avatar drahamim commented on August 30, 2024
/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.

fboender avatar fboender commented on August 30, 2024

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.

drahamim avatar drahamim commented on August 30, 2024

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.

fboender avatar fboender commented on August 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.