-
-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Notify Git Pull #7
Conversation
@@ -63,6 +63,14 @@ precmd() { | |||
unset cmd_timestamp | |||
} | |||
|
|||
# Auto notify git pull! | |||
function chpwd() { | |||
emulate -L zsh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? what does it do? we're already in zsh
Shouldn't this be async like the one in your blog post? Can you fix merge conflict? |
@sindresorhus |
@sindresorhus Was speaking to few git experts they says There was also a suggestion to use backdoor, what do you suggest? |
Go for it.
What does this mean?
Can you explain what it does and why it's needed? |
Is better than using Backdoor was suggested to emulate async process, but it was also clear that in this case async is not needed for |
Interesting. Since it's async, how does it add the message when it returns? Like, what if i write something before it's shown. Not important here, but the git branch and dirty check can be slow in large repos. Wonder if it would be possible to use it there? Like, can it dynamically update the prompt? |
It just uses FD hack to simulate async, it does not have a callback as such, but /me needs to explore it more to see if it can dynamically update the prompt. |
ping |
Sorry for the delay! For something like dynamic update of the prompt, we could use this function with |
k, can you fix the merge conflict? |
@sindresorhus It must be 🍏 now :) |
Tried it now. It only works after I do |
@sindresorhus Fine now? |
@hemanth look at the diff here, no change. I also discovered another bug. If the repo doesn't have a remote it will throw up:
|
@sindresorhus fix is to add the remote origin and do a rebase again? |
I don't understand the question? |
@sindresorhus Ha ok, I misunderstood it as an issue with merging, will work on it! |
👍 |
Can we get this finished too? I have 🐫 |
Sure! Working on :
|
ping |
@sindresorhus This shall be closed at any cost today! Sorry for this great delay! |
@sindresorhus Done, used a simple redirection, |
|
@sindresorhus Was wondering the same, |
@hemanth having to do So, it's possible to use
git pull doesn't have a dry run. Another solution would be to just do a git fetch, then run the current code, though I would prefer @pbrisbin thoughts? |
Hmm, I think it's a non-starter. This can't be done without somehow reaching out to the remote, and I don't want my prompt doing that all day long. If it were implemented, I'd quickly make a PR to add a disabling option ;). I'm just one datapoint, but that's my 2c. |
What's wrong with reaching out to the remote if it happens transparently in the background? Option ofc. |
If it's not done async (and this PR is not), then the delay is not transparent. If it is done async, then there is very good likelihood of this:
|
Isn't it possible to manipulate readline or something to get this:
|
I like this prompt because it's minimal, fast, and cleanly implemented (tabs and comments not withstanding ;)). In my opinion, this feature is not worth the impact it'd have on those three things. Again, just my 2c though. |
@sindresorhus I'm pawing at @pbrisbin There was also a suggestion to use backdoor for async, if you scroll up. But this was not blocking the shell in any way with |
Fixes issue #6