[PATCH] D64893: Ask confirmation when `git llvm push` will push multiple commits
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 13:41:06 PDT 2019
jyknight added inline comments.
================
Comment at: llvm/utils/git-svn/git-llvm:453
+ if len(revs) != 1:
+ if not ask_confirm("Are you sure?"):
+ die("abort")
----------------
mehdi_amini wrote:
> abrachet wrote:
> > Shouldn't the message be more descriptive? Maybe it should be "Multiple commits are about to be pushed. Are you sure?" The mailing list thread was specifically for newer contributors, right? I could imagine someone using `git llvm push` for the first time would imagine that was a normal message that is always given.
> The output would be:
>
> ```
> Pushing 2 monorepo commits:
> 31a4e7393ea7 Ask confirmation when `git llvm push` will push multiple commits
> c5eb9c5e2018 dummy
> Are you sure? (y/n):
> ```
I agree, it'd be better to say:
"Are you sure you want to create %d commits?"
================
Comment at: llvm/utils/git-svn/git-llvm:30
+try:
+ exec("import __builtin__") # To avoid IDE's grammar check
+except ImportError:
----------------
Instead of all the stuff with builtins, you can just do this:
```
try:
# Python 2
input = raw_input
except NameError:
input = input
```
and then below just call input().
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64893/new/
https://reviews.llvm.org/D64893
More information about the llvm-commits
mailing list