ArthurSonzogni / git-tui

Collection of human friendly terminal interface for git.
https://arthursonzogni.com
MIT License
124 stars 8 forks source link

Doesn't seem to work on Mac OSX #1

Open jeffwright13 opened 3 years ago

jeffwright13 commented 3 years ago

I was able to build from source (using make and cmake installed with brew), but invoking the commands git-tui log and git-tui diff does nothing. The commands were issued within an active repo and the plain git commands git log and git diff do show correct output.

Any ideas? It would be cool to use the diff feature instead of built-in git diff.

ArthurSonzogni commented 3 years ago

Thanks for reporting this. I can't really test on Mac OSX. What do you mean by "does nothing". Do you have something printed to in your terminal. Do you see an interface displayed?

jeffwright13 commented 3 years ago

Here is an example session when run inside an active git repo. You can see that the command is recognized by the OS and executes, but does nothing when I try to diff a file or show the git log.

/usr/local/bin/git-tui

$ git-tui
Usage:
 - git tui diff [args]*
 - git tui log [args]*

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   ../stuff/observations.md
    modified:   conftest.py
    modified:   test_fold.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    test_capture.py

no changes added to commit (use "git add" and/or "git commit -a")

$ git tui diff test_capture.py

$ git-tui diff

$ git-tui log

$ git log
commit b542467ed606781c026948073585505e74fb2c21 (HEAD -> main, origin/main)
Author: Jeff Wright <jeff.washcloth@gmail.com>
Date:   Wed Jun 30 05:42:11 2021 -0400

    Ran black on setup.py.

commit 2a1479752c50a44b7ceb02e4f956d229d2d81640
Author: Jeff Wright <jeff.washcloth@gmail.com>
Date:   Wed Jun 30 05:26:39 2021 -0400

    Added /stuff to store relics during investigation phase.
.
.
.
commit 0b1e7a5a110427a410b72bb020b44c899bfb8659
Author: Jeff Wright <jeff.washcloth@gmail.com>
Date:   Wed Jun 30 04:27:44 2021 -0400

    Initial commit.
ArthurSonzogni commented 3 years ago

Thanks!

I don't see any reason why this exit immediately. Since you managed to compile it. Could you try adding some print statement inside the main function? https://github.com/ArthurSonzogni/git-tui/blob/125d11d720debaca430322259d2f3756be521594/src/log.cpp#L104

jeffwright13 commented 3 years ago

Hello,

I did as you asked, and added a print right inside the main function of log.cpp. Still, nothing prints to console when git-tui diff is executed.

Here is the modified code.

int main(int argc, const char** argv) {
  printf("ALL YOUR MAIN BELONG TO US.\n");

  auto screen = ScreenInteractive::Fullscreen();

  (void)argc;
  (void)argv;
  std::vector<Commit*> commits;
...

Building:

$ cmake ..
git found
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Doxygen need to be installed to generate the doxygen documentation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jwr003/coding/git-tui/build

$ make install -j
Consolidate compiler generated dependencies of target screen
[ 14%] Built target screen
Consolidate compiler generated dependencies of target dom
[ 60%] Built target dom
Consolidate compiler generated dependencies of target component
[ 87%] Built target component
Consolidate compiler generated dependencies of target git-tui
[ 90%] Building CXX object CMakeFiles/git-tui.dir/src/log.cpp.o
[ 92%] Linking CXX executable git-tui
[100%] Built target git-tui
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/git-tui

Execution:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   .gitignore

no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
diff --git a/.gitignore b/.gitignore
index 2762895..fc5d8b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,5 @@ dist/
 venv/
 .venv/
 .python-version
+*.sublime*
+*.egg-info*

$ which git-tui
/usr/local/bin/git-tui

$ git-tui
Usage:
 - git tui diff [args]*
 - git tui log [args]*

$ git-tui diff

$
ArthurSonzogni commented 3 years ago

Very weird.

Could you try the examples from the FTXUI library? You should roughtly get the same output as what you get on the same examples compiled for WebAssembly: https://arthursonzogni.com/FTXUI/examples/

jeffwright13 commented 3 years ago

A little lost here (more of a Python guy than cpp). I was able to check out the FTXUI repo and successfully build it according to https://arthursonzogni.com/FTXUI/doc/#build-using-cmake. But when I issue the "./main" command I get:

$ ./main zsh: no such file or directory: ./main

On Sun, Jul 4, 2021 at 1:06 PM Arthur Sonzogni @.***> wrote:

Very weird.

Could you try the examples from the FTXUI https://github.com/ArthurSonzogni/FTXUI library? You should roughtly get the same output as what you get on the same examples compiled for WebAssembly: https://arthursonzogni.com/FTXUI/examples/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ArthurSonzogni/git-tui/issues/1#issuecomment-873626685, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA33U3TPGT6NBMSQZQLGNLTWCIIFANCNFSM47SCQPBA .

ArthurSonzogni commented 3 years ago

After building, you should normally get many executable. For instance:

/examples/components/gallery Le dim. 4 juil. 2021 à 19:44, Jeff Wright ***@***.***> a écrit : > A little lost here (more of a Python guy than cpp). I was able to check out > the FTXUI repo and successfully build it according to > https://arthursonzogni.com/FTXUI/doc/#build-using-cmake. But when I issue > the "./main" command I get: > > $ ./main > zsh: no such file or directory: ./main > > On Sun, Jul 4, 2021 at 1:06 PM Arthur Sonzogni ***@***.***> > wrote: > > > Very weird. > > > > Could you try the examples from the FTXUI > > library? > > You should roughtly get the same output as what you get on the same > > examples compiled for WebAssembly: > > https://arthursonzogni.com/FTXUI/examples/ > > > > — > > You are receiving this because you authored the thread. > > Reply to this email directly, view it on GitHub > > < > https://github.com/ArthurSonzogni/git-tui/issues/1#issuecomment-873626685 > >, > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/ABA33U3TPGT6NBMSQZQLGNLTWCIIFANCNFSM47SCQPBA > > > > . > > > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
jeffwright13 commented 3 years ago

Yes, I can confirm that the examples seem to be working. I checked out toggle, homepage and menu2.

Jeff

On Sun, Jul 4, 2021 at 5:34 PM Arthur Sonzogni @.***> wrote:

After building, you should normally get many executable. For instance:

/examples/components/gallery Le dim. 4 juil. 2021 à 19:44, Jeff Wright ***@***.***> a écrit : > A little lost here (more of a Python guy than cpp). I was able to check out > the FTXUI repo and successfully build it according to > https://arthursonzogni.com/FTXUI/doc/#build-using-cmake. But when I issue > the "./main" command I get: > > $ ./main > zsh: no such file or directory: ./main > > On Sun, Jul 4, 2021 at 1:06 PM Arthur Sonzogni ***@***.***> > wrote: > > > Very weird. > > > > Could you try the examples from the FTXUI > > library? > > You should roughtly get the same output as what you get on the same > > examples compiled for WebAssembly: > > https://arthursonzogni.com/FTXUI/examples/ > > > > — > > You are receiving this because you authored the thread. > > Reply to this email directly, view it on GitHub > > < > https://github.com/ArthurSonzogni/git-tui/issues/1#issuecomment-873626685 > >, > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/ABA33U3TPGT6NBMSQZQLGNLTWCIIFANCNFSM47SCQPBA > > > > . > > > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > < https://github.com/ArthurSonzogni/git-tui/issues/1#issuecomment-873632106 >, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/ABEJ4QQQK6P6Z7QK6A5YX33TWCMYTANCNFSM47SCQPBA > > . > — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe .
ArthurSonzogni commented 3 years ago

Very weird. I don't have any idea why the output on mac os X doesn't appear.

afeinman-snap commented 2 years ago

I'm seeing exactly this on two different Linux boxes. Both git tui log and git tui diff produce UI but no records are shown - the lists are empty Git version is 2.35.3

afeinman-snap commented 2 years ago

Update. Rebuilding from git HEAD seems to fix this for me

ArthurSonzogni commented 2 years ago

Thanks @afeinman-snap !

If someone is able to reproduce any similar problem on Mac after the current HEAD, please let me know and I will try to find a Mac to try myself. Otherwise, I will consider the problem to be magically fixed.

balint-bg commented 3 months ago

On ubuntu 22.04, git version 2.34.1, and same behavior. snap installing the tool results in empty interfaces (empty log and diff even though git log and git diff both show content). Checking out latest master (master 2809b5c [origin/master] v1.2.0) and building from source fixes this and from the same directory the TUI does show the expected diffs and logs.

ArthurSonzogni commented 3 months ago

I tried the snap version. I saw no issues. I updated the snap "stable" version to the latest build. Does it fix your issue?