extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.51k stars 571 forks source link

Gitui thought it was bare repo but is not #1273

Closed azamaulanaaa closed 2 years ago

azamaulanaaa commented 2 years ago

Describe the bug I have been using gitui for a long time. it was working well until I don't know it just does not work. in Fresh repo, clone repo, or old local repo it just does not work. i tried to debug mode and did not print anything.

To Reproduce Steps to reproduce the behavior:

  1. git init or git clone https://github.com/azamaulanaaa/pyunduh or any old repo (some repo works and some don't)
  2. $ git rev-parse --is-bare-repository
    false
    $ gitui
    invalid path
    please run gitui inside of a non-bare git repository

Expected behavior It should be working, especially fresh repo

Context:

extrawurst commented 2 years ago

if I clone your repo and run gitui on it, I do not get this error 🤔

azamaulanaaa commented 2 years ago

I found the pattern.

gitui does not work if the repo is located on a mounted partition. weird. gitui will error bare repo on it if tho is not.

extrawurst commented 2 years ago

can you give me some instructions how to create such a mounted partition for testing purposes so I can reproduce the issue?

azamaulanaaa commented 2 years ago

partition : /dev/sdb3 filesystem : ntfs mounted on : /mnt/data

log:

[azama@fedora ~]$ lsblk -f /dev/sdb
NAME  FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sdb
├─sdb1
│     vfat   FAT16       5C3B-EC8B                              79.8M    15% /boot/efi
├─sdb2
│     ext4   1.0         58d5c10e-fb2b-41e3-a0ab-7e16a20232fd   37.1G    52% /
└─sdb3
      ntfs               2227C25408CD9314                       33.4G    32% /mnt/data
[azama@fedora ~]$ mount | grep sdb3
/dev/sdb3 on /mnt/data type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096,x-gvfs-show)
[azama@fedora ~]$ cd /mnt/data/projects/pyunduh
[azama@fedora pyunduh]$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
[azama@fedora pyunduh]$ git rev-parse --is-bare-repository
false
[azama@fedora pyunduh]$ gitui
invalid path
please run gitui inside of a non-bare git repository
azamaulanaaa commented 2 years ago

git config

[azama@fedora pyunduh]$ git config --list
user.name=Aza Maulana
user.email=[sensored]
core.editor=nvim
safe.directory=*
credential.helper=store
init.defaultbranch=main
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/azamaulanaaa/pyunduh
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
extrawurst commented 2 years ago

ok I don't get it. what exactly are the instructions how to create a mount to reproduce this now?

azamaulanaaa commented 2 years ago

Context Partition : /dev/sdc1 FileSystem : NTFS Mount dir : /mnt/sdc1 Disk type : USB Flash Drive

Shell script

#!/bin/sh
partition=/dev/sdc1
mount_dir=/mnt/sdc1
sudo mkfs -t ntfs -f $partition
sudo mkdir -p $mount_dir
sudo mount -t auto -o nosuid,nodev,nofail,x-gvfs-show $partition $mount_dir
mkdir -p $mount_dir/repo
cd $mount_dir/repo
git init
gitui

stdout

Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
Initialized empty Git repository in /mnt/sdc1/repo/.git/
invalid path
please run gitui inside of a non-bare git repository

Note : I tried my best to replicate my ssd mount setting on fstab.

Extra Note: gitui will works just fine if the partition mounted by gnome-disk-utility with the default setting

laktak commented 2 years ago

You have safe.directory=* in your config. See #1293 for a workaround.

extrawurst commented 2 years ago

ok seems to be a duplicate of #1293