Powerlevel10k: Git unstaged changes on a clean repo

Created on 4 Dec 2019  路  10Comments  路  Source: romkatv/powerlevel10k

Hi.

I have a clean repo but the prompt says there are 13 unstaged chnages:
Screenshot from 2019-12-04 16-30-37

Most helpful comment

If there is anything else I can do to help out please let me know.

The fact that you were unable to get back to the previous state gave me an idea of what might have happened and I was able to reproduce this after a few trial-and-error attempts.

Here's a simple way to reproduce the problem:

cd /tmp
mkdir repo
cd repo
git init
touch x
git add x
git commit -m first
chmod 677 x

At this point git status will say there are no unstaged changes while gitstatus will say that x is modified.

I've submitted two fixes. With the next release gitstatus will be in agreement with git w.r.t. files with weird mode bits. Given that it's not a serious bug, I'm not going to push an emergency release.

Thanks for the bug report and for your help debugging this issue!

All 10 comments

Please execute the following command and attach /tmp/gitstatus.txt to this issue (you can drag and drop the file into the comment edit box).

(
  emulate -L zsh
  setopt err_return
  cd ~/work/siiue2020/siiue
  typeset -m 'ZSH_VERSION|ZSH_PATCHLEVEL'
  zsh --version
  git config -l
  git status --ignored
  local tmp
  tmp="$(mktemp -d ${TMPDIR:-/tmp}/gitstatus.XXXXXXXXXX)"
  {
    git clone --depth=1 https://github.com/romkatv/gitstatus.git $tmp
    zsh -dfeic "
      GITSTATUS_LOG_LEVEL=DEBUG
      source ${(q)tmp}/gitstatus.plugin.zsh
      gitstatus_start -s -1 -u -1 -c -1 -d -1 -m -1 MY
      gitstatus_query MY
      typeset -m 'VCS_STATUS_*'
      sleep 1
      gitstatus_query MY
      typeset -m 'VCS_STATUS_*'
      cat \$GITSTATUS_DAEMON_LOG_MY"
  } always {
    rm -rf $tmp
  }
) &>/tmp/gitstatus.txt

Here you go...

gitstatus.txt

gitstatus thinks that 13 files don't have executable bit set in the index but do have it set in the work tree. Since core.filemode in the git config is set to true, these files are counted as unstaged modified. These are the files:

bootstrap/app.php
bootstrap/autoload.php
bootstrap/cache/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/debugbar/.gitignore
storage/framework/cache/data/.gitignore
storage/framework/cache/.gitignore
storage/framework/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore

Let's focus on the first to figure out what's going on. Please post the output of the following command:

() {
  emulate -L zsh -o xtrace
  command git ls-files --debug -s -- "$@"
  command ls -l "$@"
} bootstrap/app.php

Edit: The command should be executed from ~/work/siiue2020/siiue.

Thanks for the insight. Don't really know why they have different permissions. Fixed them and the count went to zero.

What I don't understand is why git status didn't show them as modified...

Thanks for your help

Awww 馃槵

Could you please restore the permissions, verify that everything is just as before, run the command I posted above and post its output?

I'm sorry... Since you identified the problem and I could fix it I thought that test was no longer necessary. Unfortunately, if I restore the permissions, the files appear as modified, as they have been in the first place... :disappointed:

If there is anything else I can do to help out please let me know.

If there is anything else I can do to help out please let me know.

The fact that you were unable to get back to the previous state gave me an idea of what might have happened and I was able to reproduce this after a few trial-and-error attempts.

Here's a simple way to reproduce the problem:

cd /tmp
mkdir repo
cd repo
git init
touch x
git add x
git commit -m first
chmod 677 x

At this point git status will say there are no unstaged changes while gitstatus will say that x is modified.

I've submitted two fixes. With the next release gitstatus will be in agreement with git w.r.t. files with weird mode bits. Given that it's not a serious bug, I'm not going to push an emergency release.

Thanks for the bug report and for your help debugging this issue!

FYI: I've released a new version of gitstatusd-linux-x86_64. This is the one you are using. Once you update powerlevel10k, you should no longer see discrepancies between git status and your prompt. If you ever do, please open another issue.

@romkatv Awesome! Thanks for the great support! This is how it's done! Great job!

Btw, a little off topic, but is there a recommended way of keeping powerlevel10k up to date? I'm just git pull'ing away...

Thanks again.

Btw, a little off topic, but is there a recommended way of keeping powerlevel10k up to date? I'm just git pull'ing away...

This depends on your plugin manager. If git pull works, then it works. It's what I do as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

romkatv picture romkatv  路  5Comments

maximbaz picture maximbaz  路  7Comments

zemuldo picture zemuldo  路  4Comments

alex-popov-tech picture alex-popov-tech  路  4Comments

ImKifu picture ImKifu  路  3Comments