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

Support for svn status in prompt #2582

Closed
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@samdmarshall
Contributor

samdmarshall commented Dec 5, 2015

This is to add support for displaying the output of svn status in a prompt similar to the way git and hg status get displayed. I tried to match the styling and conventions as best as I could, please let me know if there is any glaring issues with it.

Note: I wrote this against fish 2.2.0, so it doesn't take advantage of any of the new string manipulation features as there hasn't been published release that includes support for that yet. I would be happy to update this once a new release is made.

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 9, 2015

Member

The sed and grep calls could be replaced with string (not in a release yet, unfortunately).

Member

faho commented Dec 9, 2015

The sed and grep calls could be replaced with string (not in a release yet, unfortunately).

@faho faho self-assigned this Dec 9, 2015

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 9, 2015

Member

I'll have to test this now. Any nice svn repo to try?

Member

faho commented Dec 9, 2015

I'll have to test this now. Any nice svn repo to try?

@samdmarshall

This comment has been minimized.

Show comment
Hide comment
@samdmarshall

samdmarshall Dec 9, 2015

Contributor

Heh, the only public one that comes to mind is the llvm repos. This seems most work out of the svn repos I use at work.

Contributor

samdmarshall commented Dec 9, 2015

Heh, the only public one that comes to mind is the llvm repos. This seems most work out of the svn repos I use at work.

@faho faho referenced this pull request Dec 9, 2015

Closed

VCS-agnostic prompts #2592

refactor of __fish_print_svn_rev to not depend on english locale, min…
…or changes to _fish_svn_prompt to optimize execution
@samdmarshall

This comment has been minimized.

Show comment
Hide comment
@samdmarshall

samdmarshall Dec 10, 2015

Contributor

OK I've updated with changes we discussed, how does it look now?

Contributor

samdmarshall commented Dec 10, 2015

OK I've updated with changes we discussed, how does it look now?

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 10, 2015

As I said - this tr dance isn't necessary.

faho commented on share/functions/__fish_svn_prompt.fish in 37a15d3 Dec 10, 2015

As I said - this tr dance isn't necessary.

@samdmarshall

This comment has been minimized.

Show comment
Hide comment
@samdmarshall

samdmarshall Dec 10, 2015

Contributor

Sorry about that, when i tried it out again I think i forgot to add the \n into the printf formatter not realizing that would make a significant difference in output handling. That should be fixed now.

Contributor

samdmarshall commented Dec 10, 2015

Sorry about that, when i tried it out again I think i forgot to add the \n into the printf formatter not realizing that would make a significant difference in output handling. That should be fixed now.

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 10, 2015

Member

The svn status thing is still not perfect, but given that I haven't been able to trigger it and that I don't know of any better way to do it, it's probably okay.

I'll test the new version a bit more and if it passes I'll merge.

Member

faho commented Dec 10, 2015

The svn status thing is still not perfect, but given that I haven't been able to trigger it and that I don't know of any better way to do it, it's probably okay.

I'll test the new version a bit more and if it passes I'll merge.

@samdmarshall

This comment has been minimized.

Show comment
Hide comment
@samdmarshall

samdmarshall Dec 10, 2015

Contributor

OK, once a release of fish shell is made with the new string stuff I'll submit another PR converting the code over to using that where it can. That might give a bit more control around the filtering the additional lines out of svn status, I couldn't work out a simple way of doing it without introducing a lot of overhead with a set of awk commands or similar.

Contributor

samdmarshall commented Dec 10, 2015

OK, once a release of fish shell is made with the new string stuff I'll submit another PR converting the code over to using that where it can. That might give a bit more control around the filtering the additional lines out of svn status, I couldn't work out a simple way of doing it without introducing a lot of overhead with a set of awk commands or similar.

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 10, 2015

Member

That last commit changed the time from 255357 to 258585 (fish -p profile -c "__fish_svn_prompt")- in other words barely, if at all, measurable.

I've managed to get a 20% improvement, though, by removing the `math´ call.

Member

faho commented Dec 10, 2015

That last commit changed the time from 255357 to 258585 (fish -p profile -c "__fish_svn_prompt")- in other words barely, if at all, measurable.

I've managed to get a 20% improvement, though, by removing the `math´ call.

# the default separator is empty
set -l prompt_separator ""
for index in (seq (math "$col - $last_column"))

This comment has been minimized.

@faho

faho Dec 10, 2015

Member

Since you're not using $index inside the loop, you can just do seq $last_column $col. Or am I missing anything?

@faho

faho Dec 10, 2015

Member

Since you're not using $index inside the loop, you can just do seq $last_column $col. Or am I missing anything?

This comment has been minimized.

@samdmarshall

samdmarshall Dec 10, 2015

Contributor

it looks like it iterates an extra time when doing seq $last_column $col vs seq (math "$col - $last_column")

@samdmarshall

samdmarshall Dec 10, 2015

Contributor

it looks like it iterates an extra time when doing seq $last_column $col vs seq (math "$col - $last_column")

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Dec 10, 2015

Member

I've merged this now since it's nice code that works and the time is dominated by the svn calls (I can't seem to replicate the math thing anymore). I've squashed it to f5dfebb.

Thanks for the nice work and quick response!

Member

faho commented Dec 10, 2015

I've merged this now since it's nice code that works and the time is dominated by the svn calls (I can't seem to replicate the math thing anymore). I've squashed it to f5dfebb.

Thanks for the nice work and quick response!

@faho faho closed this Dec 10, 2015

@samdmarshall samdmarshall deleted the samdmarshall:sdm-svn-prompt branch Dec 10, 2015

@faho faho added the release notes label Dec 11, 2015

@faho faho added this to the next-2.x milestone Dec 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment