emacs-evil / evil-magit

Black magic or evil keys for magit
https://github.com/justbur/evil-magit
GNU General Public License v3.0
272 stars 16 forks source link

evil-magit-add-rebase-messages does not insert commands in buffer when locale is different from english #81

Closed oggers closed 4 years ago

oggers commented 4 years ago

My linux box has spanish locale, so git messages are generated in spanish.

When I do a git rebase the git-rebase-todo file is in spanish. You are inserting rebase key bindings only if this condition is true (line 507 in evil-magit.el):

 (when (and (boundp 'git-rebase-show-instructions)
                        git-rebase-show-instructions
                        (re-search-forward "^# Commands:\n" nil t))

but in the spanish message you will never find the word "Commands", instead you get "Comandos:", therefore it will never insert the key bindings.

Sample git-rebase-todo generated in a spanish linux:

pick 689d051 Working

# Rebase d317ddf..689d051 en c49fa71 (5 comandos)
#
# Comandos:
# p, pick <commit> = usar commit
# r, reword <commit> = usar commit, pero editar el mensaje de commit
# e, edit <commit> = usar commit, pero parar para un amend
# s, squash <commit> = usar commit, pero fusionarlo en el commit previo
# f, fixup <commit> = como "squash", pero descarta el mensaje del log de este co
mmit
# x, exec <commit> = ejecuta comando ( el resto de la línea) usando un shell
# b, break = parar aquí (continuar rebase luego con 'git rebase --continue')
# d, drop <commit> = eliminar commit
# l, label <label> = poner label al HEAD actual con un nombre
# t, reset <label> = reiniciar HEAD a el label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       crea un commit de fusión usando el mensaje original de
# .       fusión (o la línea de oneline, si no se especifica un mensaje
# .       de commit). Use -c <commit> para reescribir el mensaje del commit.
#
# Estas líneas pueden ser reordenadas; son ejecutadas desde arriba hacia abajo.
#
# Si eliminas una línea aquí EL COMMIT SE PERDERÁ.
#
# Como sea, si quieres borrar todo, el rebase será abortado.
#

I think the same happens in all other languages that uses a different word for "commands".

justbur commented 4 years ago

Thanks. Can you try 253c644807013fe92429acdef418748794b8f254 ?

oggers commented 4 years ago

It works, Thank you!!

Do you know when it will be deployed to melpa?

justbur commented 4 years ago

It takes a couple of hours on average I think.

On Thu, Apr 9, 2020 at 3:55 PM Juan Carlos Coruña notifications@github.com wrote:

It works, Thank you!!

Do you know when it will be deployed to melpa?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/emacs-evil/evil-magit/issues/81#issuecomment-611723055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ3E7UGLCEOBBYQ5TISTPLRLYR3NANCNFSM4MELH4YQ .