Re: [PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-15 Thread Matthieu Moy
Remi Galan Alfonso remi.galan-alfo...@ensimag.grenoble-inp.fr writes: Matthieu Moy matthieu@grenoble-inp.fr writes: Remi Galan Alfonso remi.galan-alfo...@ensimag.grenoble-inp.fr writes: It is mainly because here the SHA-1 is a long one (40 chars) OK, but then the minimum would be to

Re: [PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-13 Thread Remi Galan Alfonso
Matthieu Moy matthieu@grenoble-inp.fr writes: Remi Galan Alfonso remi.galan-alfo...@ensimag.grenoble-inp.fr writes: It is mainly because here the SHA-1 is a long one (40 chars) OK, but then the minimum would be to add a comment saying that. Now, this makes me wonder why you are

[PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-10 Thread Galan Rémi
Check before the start of the rebasing if the commands exists, and for the commands expecting a SHA-1, check if the SHA-1 is present and corresponds to a commit. In case of error, print the error, stop git rebase and prompt the user to fix with 'git rebase --edit-todo' or to abort. This allows to

Re: [PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-10 Thread Matthieu Moy
Remi Galan Alfonso remi.galan-alfo...@ensimag.grenoble-inp.fr writes: It is mainly because here the SHA-1 is a long one (40 chars) OK, but then the minimum would be to add a comment saying that. Now, this makes me wonder why you are doing the check after the sha1 expansion and not before.

Re: [PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-10 Thread Remi Galan Alfonso
+git stripspace --strip-comments | +while read -r command sha1 rest +do +case $command in +''|noop|x|exec) +;; +pick|p|drop|d|reword|r|edit|e|squash|s|fixup|f) +

Re: [PATCH/RFCv5 3/3] git rebase -i: add static check for commands and SHA-1

2015-06-10 Thread Matthieu Moy
Galan Rémi remi.galan-alfo...@ensimag.grenoble-inp.fr writes: +# from the todolist in stdin +check_bad_cmd_and_sha () { + git stripspace --strip-comments | + while read -r command sha1 rest + do + case $command in + ''|noop|x|exec) +