Skip to content
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

Improve command for showing alias list #25

Merged
merged 1 commit into from
Feb 27, 2017
Merged

Conversation

Volendi
Copy link
Contributor

@Volendi Volendi commented Feb 23, 2017

Now aliases shown as table that is better for understanding.

@Volendi Volendi changed the title Improve comand for showing alias list Improve command for showing alias list Feb 23, 2017
@phdru
Copy link
Contributor

phdru commented Feb 23, 2017

The result looks a bit better mostly but:

  • Why have you changed regexp from '^alias' to 'alias'?
  • If an alias' name is long (like 'push-to-all-remotes') the alias is indented with tabs too much.

Overall I'm +0.

@Volendi
Copy link
Contributor Author

Volendi commented Feb 23, 2017

Hi @phdru

Thank you for suggestions. Yes, sure, you are right that '^alias' is better. Fixed it. Also improved columns output that solves the second problem.

@phdru
Copy link
Contributor

phdru commented Feb 23, 2017

Yep, seems to be better. I'm +0.5 now. More suggestions:

  • Restore regexp back to '^alias\.'
  • Rebase all these commits, combine them into one and force-push so that the PR has 1 commit — for clean history.

@SixArm
Copy link

SixArm commented Feb 24, 2017

Thanks for your pull request. Here's my feedback and I greatly value you taking the time to contribute the request.

I like the change from colrm to cut because I just learned colrm is removed from POSIX 2 in favor of cut.

The awk change seems to have a bug. When an alias contains the same symbol you're using as a separator, are you expecting all the separators to be replaced? In general, character separators can be a tricky area, and it's even trickier on systems with encodings that aren't set to UTF8. Better to use sed, which can replace just the first occurrence. Also, the sed command and syntax tends to be easier/faster than awk for coders to understand, because sed syntax is similar in many popular languages.

The change from " = " to a tab is a veto, because the intent of the " = " separator is to make the output syntax match the git config file syntax, i.e. to make an alias statement essentially round-trippable so what a person writes in the git config alias section is what prints out. The match is not fully perfect yet, just close. (That said, you're welcome and able to customize your own aliases command simply by adding it in your gitconfig file)

Now aliases shown as table that is better for understanding.
@Volendi
Copy link
Contributor Author

Volendi commented Feb 27, 2017

Hi @SixArm , thank you for feedback. For me, tabs are better, but I get what you mean. So I changed only colrm to cut and alias to aliases. alias may create alias, so I tend to believe that aliases is better to show list.

@SixArm
Copy link

SixArm commented Feb 27, 2017

Good, thank you for your updates and your understanding. I'm merging now.

@SixArm SixArm merged commit bccc9cd into GitAlias:master Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants