joh/when-changed

Not working with git log

goldylucks opened this issue · 7 comments

Thank you so much for this project!

Anything I'm doing wrong?

Peek 2019-08-04 20-27

The same command works with linux's built in watch:

Peek 2019-08-04 20-29

joh commented

Interesting use case! By default, .git directories are ignored by when-changed. See https://github.com/joh/when-changed/blob/master/whenchanged/whenchanged.py#L53
You can comment out that line and it should work.

Thanks for the response!

I commented that line out, restarted gnome, opened a fresh terminal, and still doesn't work :/

any other ideas we can try?

joh commented

Hmm, it works for me here. Did you remember to install your modified version with pip install .?

Btw, to run git log whenever you change branches it might be better to watch .git/HEAD...

Hmm, it works for me here

So now it only refreshes if I focus on the terminal and press q. For you it refreshes automatically when you change a branch or add a commit?

I can't get that to work :/

Do you have a vid/gif showing it in action? to make sure we are talking about the same behavior here.

joh commented

Ah, your git log is probably waiting for pager input. Try with git --no-pager log instead.

ok that works, thanks for pointing that out!
now I'm seeing many "re-renders" of git log when I make a change:

whe-changed

TBH, working with watch is fine by me, just would be nice to not poll if I can listen to changes, but don't sweat about it, so feel free to close this issue.

my idea might be a very edgy use case

joh commented

You could try the -1 option. Also maybe use clear && git --no-pager log as the command.