-
Notifications
You must be signed in to change notification settings - Fork 146
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
Updates for a faster link command. #119
Conversation
Dayum, this looks really nice :-) |
paths="$relpath$path\n$paths" | ||
done | ||
done | ||
pending "list files" "$repo_dir" >&2 |
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.
It may be good to consider logging everything in homeshick to stderr
instead of most things to stdout
, and only errors to stderr
(from what I remember of my brief look at log.sh
, I think that is the current behavior). Logging to stderr in bash scripts enables you to log things without polluting stdout
, which often gets piped around or evaluated by other functions. I would be happy to do the work if you feel like it is a good idea as well.
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.
Oh, and this line along with the success line at the end of the function lets the user know an operation is happening so impatient fools (like myself) are less likely to CTRL-C after a few seconds because it looks like nothing is happening 😄.
BTW, I really like the way you have done your logging with the pending
/ success
functions - it looks really slick.
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.
I think anything other than progress should be logged to stdout
, it should be machine-readable however (I created #70 a long time ago to track progress on that, still haven't gotten around to it :-)).
BTW, I really like the way you have done your logging with the pending / success functions - it looks really slick.
Thanks! It was fun to code as well, hehe.
Holy balls! The speedup is insane! I didn't even have the patience to wait for the current version to list all of the >3000 files. The new version takes about 30s, I'm impressed :-) |
- Don't store intermediate `paths` variable; use pipes. - Use process substitution to speed up loops.
- IFS manipulation did not appear to be doing anything helpful, so I removed it. - Linking files with a newline is not actually fixed, but the behavior did change slightly, so I updated the test.
Hopefully this set of commits looks better. Sorry about the force push - I figured that was the best way to do it, but you will have to |
Don't be
It is :-)
No need, a simple diff shows me that nothing's changed since I last tested it. Merging... p.s.: This is a great improvement to the |
Updates for a faster link command.
paths
variable; use pipes.behavior did change slightly, so I updated the test.