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

Proposal: git aacanepush #108

Open
hyperupcall opened this issue Nov 18, 2023 · 12 comments
Open

Proposal: git aacanepush #108

hyperupcall opened this issue Nov 18, 2023 · 12 comments

Comments

@hyperupcall
Copy link

When working with CI, it is common to make edits and and force push those changes to CI. I propose an alias to shorten three commands to do so, into one: git aacanepushy

git aa: git add --all
git cane: git commit --amend --no-edit
git pushy: git push --force-with-lease

I have a similar personal alias: git aacamnepf, that I use almost every day. So I thought something like that might be useful to other people. If there is interest, I'll gladly make a PR

@joelparkerhenderson
Copy link
Member

Neat! This is the first time someone's doing this. Good initiative Sure, go for it.

For your PR, can you also add an description of how & when you use it? (Or when a developer would want to use it?)

@phdru
Copy link
Contributor

phdru commented Nov 24, 2023

The name aacanepushy is too long for my taste and unreadable. :-(

@joelparkerhenderson
Copy link
Member

@phdru What do you feel is a better name?

@phdru
Copy link
Contributor

phdru commented Nov 25, 2023

Ouch, that a hard question! I hope you remember the joke about 2 hard problems: https://martinfowler.com/bliki/TwoHardThings.html

«Cache invalidation, naming things, and off-by-1 errors.»

What about git addamendpush? git add-amend-push?

@joelparkerhenderson
Copy link
Member

Ha! Yes you're right. Perhaps brainstorm the purpose?

Yes I worked with Martin for a bit. My team had this... The four hard things concurrency in computer science are naming things, exactly-once delivery, cache invalidation, exactly-once delivery, and off-by-one errors.

@phdru
Copy link
Contributor

phdru commented Nov 25, 2023

git acap for add/commit-amend/push?

Even shorter git aap?

@hyperupcall
Copy link
Author

git acap sounds good! Another alternative is acp for "add, commit, push".

@joelparkerhenderson
Copy link
Member

joelparkerhenderson commented Nov 29, 2023

Good brainstorming. How about some ideas that are words for the purpose, intent, or goal?

Shorthands such as "acp" are hard, because what you're aiming to do is an atypical add (i.e. add all), an atypical commit (i.e. commit amend no edit), and an atypical push (with a force). In a well-managed codebase, this should be a highly rare event that's a bit like a big sledgehammer, and a bit unlike a precision scalpel, yes?

Or, if this is more frequent, then is it possibly an aspect of a typical workflow, such as your usual workflow to trigger a topic branch CI? Could any of the gitalias topic-* aliases help here?

@hyperupcall
Copy link
Author

hyperupcall commented Dec 5, 2023

True haha, the command is like a sledgehammer. I don't think that the topic-* aliases would apply here since this command is meant to be used forcibly on an existing branch, rather than create a new one. But, this could be better placed under the "misc" section under "workflow aliase".

Using words that serve intent or purpose, ideas include git commit-all-and-push ('commit-all' referring to 'commit -a'), git force-push-tracked, or git commit-amend-tracked-and-pushy. It is difficult to come up with something that is both short and memorable.

@joelparkerhenderson
Copy link
Member

What I mean by intent, is things more like... how would you describe this to someone who doesn't know git, what are you doing that makes these commands helpful, or what names could you use to explain the situation that you would be in that make these commands good?

As just some examples of ones that I personally use for my own aliases like this... yikes, oops, rescind, unbotch, or a bunch of wizard spell names, or Latin & Greek words, or made-up expressions, or a suffix, etc.

You're able to see some of these in GitAlias, such as purpose ones (e.g. churn, hew), situational ones (e.g. panic, wip), spell-like ones (e.g. publish, serve), suffix ones (e.g. initer, repacker).

@hyperupcall
Copy link
Author

Ohh, I see - so something more semantic and/or situational.

  • git retry or (retry-ci) would describe the situation in which CI fails, and you want to "retry" it with new code
  • git replace-tip describes what the alias does at a high-level, without using git terms. You have a history of changes, and you want to replace the most recent change (tip) (HEAD, origin/HEAD) with your current changes
  • git override - similar to the second bullet point; different name

I think git retry-ci sounds the best to me. What do you think?

@joelparkerhenderson
Copy link
Member

joelparkerhenderson commented Feb 1, 2024

Excellent! Your new suggestions are better, clearer, more semantic, more situational.

You're describing your situation where you want to make amends, to compensate for your previous bad/unwanted CI failure run, and to supply satisfaction for a new CI run.

There's a word that means what you're writing: atone.

See https://www.merriam-webster.com/dictionary/atone and the "Did you know?" section too.

I would be stoked to have your new alias be "git atone". What do you think?

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

No branches or pull requests

3 participants