Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Doesn't seem to work on Mac OSX #1

Open
jeffwright13 opened this issue Jun 30, 2021 · 14 comments
Open

Doesn't seem to work on Mac OSX #1

jeffwright13 opened this issue Jun 30, 2021 · 14 comments

Comments

@jeffwright13
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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?

int main(int argc, const char** argv) {

@jeffwright13
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

jeffwright13 commented Jul 4, 2021 via email

@ArthurSonzogni
Copy link
Owner

ArthurSonzogni commented Jul 4, 2021 via email

@jeffwright13
Copy link
Author

jeffwright13 commented Jul 4, 2021 via email

@ArthurSonzogni
Copy link
Owner

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

@afeinman-snap
Copy link

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
Copy link

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

@ArthurSonzogni
Copy link
Owner

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
Copy link

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
Copy link
Owner

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants