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

refactor(aliases): sort #1743

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

georgettica
Copy link
Contributor

  • move all comments to the same line so they wont be jumbled

@georgettica
Copy link
Contributor Author

related to #1732

@georgettica
Copy link
Contributor Author

now it's partially related to #1696

@davidpfarrell
Copy link
Contributor

Greetings!

A straight sort is useful, but I'm inclined to think that grouping by sub-command or maybe related actions has value too:

#
# Adding
#
alias ga* ...
...

# 
# Branching
# 
alias gb* ...
...

# 
# Committing
# 
alias gc* ...
...

The alias file serves as its own documentation, as there's (currently) no other way to know what aliases an alias file introduces, nor to get detailed info on a specific alias, other than to look inside the alias file itself.

To that end, I think we should have some kind of goal for alias files to read well.

@georgettica
Copy link
Contributor Author

It was just very hard to sort with the comments sparsed that way.
I thought maybe we could give it. A try this way but can put comments back if you want.

Or if you have a good sorting technique that keeps comments bear them I would be glad to hear about it

@davidpfarrell
Copy link
Contributor

Hi again,

It was just very hard to sort with the comments sparsed that way.
I thought maybe we could give it. A try this way but can put comments back if you want.

My comment wasn't related to the idea of moving alias doc-comments to a single line - It was related the idea of blindly sorting sorting the aliases in general. (I understand that, when moving these around en-mass, moving the alias comments to the same line makes it easier to keep them with their associated alias)

I think that, if we're going to re-arrange the aliases, we should have a better goal than just plainly sorting them.

Organizing them by some common feature/function makes more sense to me. THIS is what I referring to in my comment.
NOTE: This may result in aliases not ending up in precisely sorted order, which is OK.

Additionally, I think you may have added too many changes to this PR, ie changes to the following files:

  • containerized_lint.sh
  • install.sh
  • testing.Dockerfile

These changes don't really ave anything to do with the git aliases themselves.

They seem useful, but they should be part of a separate, stand-alone PR and not part of this one. I recommend moving them into a separate, new PR so we can discuss them (and possibly merge them) regardless of what happens here in this PR.

-DF

@NoahGorny
Copy link
Member

@georgettica I agree with @davidpfarrell

Move the docker commit to a separate PR and remove it and the auto-reload one from this PR, and then we can continue with this one.

Great job by the way! Keep up the good work 😄

@georgettica
Copy link
Contributor Author

That sounds great!
A. I am glad you are onboard.
B. I will sort based on what you wanted @davidpfarrell
C. I will split into multiple pieces

georgettica added a commit to georgettica/bash-it that referenced this pull request Dec 27, 2020
@georgettica georgettica force-pushed the georgettica/sort-git-aliases branch 2 times, most recently from e5234f5 to 4a9e342 Compare December 27, 2020 16:48
@georgettica
Copy link
Contributor Author

diverged dockerfile and linting into #1753
removed duplication from here, and tried to fix comments as was requested, please tell me if it looks ok now

@NoahGorny
Copy link
Member

nice work @georgettica!

I think that what you did with the git stash and git switch aliases is the way we should do it. The actual order does not have to be alphabetical- but rather sorted by command- git add, git branch, git commit, etc...

Lemme know what you think!

@georgettica
Copy link
Contributor Author

I am fine with that :)

@NoahGorny
Copy link
Member

any updates @georgettica ?

@georgettica
Copy link
Contributor Author

You want more sections? Or is that enough

@NoahGorny
Copy link
Member

I want to do this all in this PR, so we can make sure the file will stay sorted after your PR. If you can finish this up with sections as I said it would be amazing!

@georgettica
Copy link
Contributor Author

Now that I know, I'll do that

@NoahGorny NoahGorny force-pushed the georgettica/sort-git-aliases branch 2 times, most recently from 0534601 to c3a01db Compare January 8, 2021 22:49
@NoahGorny
Copy link
Member

hey @georgettica, I updated your PR with a rebase on master and some changes, you are welcome to look at my addition (c3a01db) and see if you like it

@cornfeedhobo @davidpfarrell @nwinkler @tbhaxor
can one of you CR this as I also made some changes myself?

Copy link
Contributor Author

@georgettica georgettica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @NoahGorny fixing as you see fit, it really pushes this PR to conclusion I think.

For me it looks ok (though I can't approve)

@NoahGorny
Copy link
Member

@cornfeedhobo wanna take a look?

Copy link
Contributor

@davidpfarrell davidpfarrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new organization strategy looks good!

I spent some time comparing the old and new versions of the file to confirm that every alias was covered. Everything appears to be there.

Best I can tell, this is good to go - thanks for the effort !

@davidpfarrell
Copy link
Contributor

As a side note : We may need to adopt a more nuanced policy regarding quotes used for alias definitions ... The "Always use ' " policy feels a little stifling

Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased again, and merging as @davidpfarrell approved.
Thank you guys for the effort you put in @georgettica @davidpfarrell ! You rock!

@NoahGorny NoahGorny merged commit bac5041 into Bash-it:master Jan 13, 2021
@georgettica georgettica deleted the georgettica/sort-git-aliases branch January 13, 2021 17:45
@georgettica
Copy link
Contributor Author

Thanks for helping aswell @NoahGorny

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