unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* git problems: >78 column commit message created by git revert.  I'm stuck.  What do I do?
@ 2018-10-03 12:49 Alan Mackenzie
  2018-10-03 13:46 ` Stefan Monnier
  2018-10-03 23:41 ` Noam Postavsky
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Mackenzie @ 2018-10-03 12:49 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

Yet another git problem.

I did git revert -e <hash-1> <hash-2>, committing the results to my
local git repository.

I then did git pull --rebase.  This failed with the message "Line longer
than 78 characters in commit message".  The revert operation created log
messages with very long lines.  :-(

Then, following the suggestion in the error message, I did git rebase
--abort, to get back to a stable state.

However, I now have two unrebaseable commits in my repo, and it seems
likely the savannah server would reject them anyway.

I'd like to use git commit --amend, but this can only change one of the
two commit messages created by git revert.

How can I resolve this mess?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git problems: >78 column commit message created by git revert. I'm stuck. What do I do?
  2018-10-03 12:49 git problems: >78 column commit message created by git revert. I'm stuck. What do I do? Alan Mackenzie
@ 2018-10-03 13:46 ` Stefan Monnier
  2018-10-03 23:41 ` Noam Postavsky
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2018-10-03 13:46 UTC (permalink / raw)
  To: emacs-devel

> I then did git pull --rebase.  This failed with the message "Line longer
> than 78 characters in commit message".  The revert operation created log
> messages with very long lines.  :-(

When you `git commit` you can skip the "78 char" check with `--no-verify`,
but indeed, I can't see how to do the equivalent within `git
pull --rebase` or `git rebase` (at least according to the manpage: `git
rebase` has a `--no-verify` option as well, so maybe that will work,
but the doc says it only affects the use of .git/hooks/pre-rebase).

You can rm .git/hooks/commit-msg, tho.

Also you can `git pull` without the `--rebase`.

> However, I now have two unrebaseable commits in my repo, and it seems
> likely the savannah server would reject them anyway.

Those checks are only performed locally: the savannah server will
happily accept commits that don't abide by those rules.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git problems: >78 column commit message created by git revert. I'm stuck. What do I do?
  2018-10-03 12:49 git problems: >78 column commit message created by git revert. I'm stuck. What do I do? Alan Mackenzie
  2018-10-03 13:46 ` Stefan Monnier
@ 2018-10-03 23:41 ` Noam Postavsky
  2018-10-06  9:17   ` Alan Mackenzie
  1 sibling, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2018-10-03 23:41 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Emacs developers

On Wed, 3 Oct 2018 at 08:56, Alan Mackenzie <acm@muc.de> wrote:

> I'd like to use git commit --amend, but this can only change one of the
> two commit messages created by git revert.
>
> How can I resolve this mess?

For the record, you can change the messages of multiple previous
commits using rebase:

git rebase --interactive HEAD~2

This will pop up your $EDITOR. Change the occurrences of "pick" into
"reword", then save and exit. You will then be able to edit each
commit message in turn (again, in $EDITOR).



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git problems: >78 column commit message created by git revert. I'm stuck. What do I do?
  2018-10-03 23:41 ` Noam Postavsky
@ 2018-10-06  9:17   ` Alan Mackenzie
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2018-10-06  9:17 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Emacs developers

Hello, Noam.

On Wed, Oct 03, 2018 at 19:41:17 -0400, Noam Postavsky wrote:
> On Wed, 3 Oct 2018 at 08:56, Alan Mackenzie <acm@muc.de> wrote:

> > I'd like to use git commit --amend, but this can only change one of the
> > two commit messages created by git revert.
> >
> > How can I resolve this mess?

> For the record, you can change the messages of multiple previous
> commits using rebase:

> git rebase --interactive HEAD~2

> This will pop up your $EDITOR. Change the occurrences of "pick" into
> "reword", then save and exit. You will then be able to edit each
> commit message in turn (again, in $EDITOR).

Thanks.  I'll have a look at that sometime.  I actually fixed the
immediate problem with Stefan's suggestion, temporarily removing the git
hook.

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-06  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-03 12:49 git problems: >78 column commit message created by git revert. I'm stuck. What do I do? Alan Mackenzie
2018-10-03 13:46 ` Stefan Monnier
2018-10-03 23:41 ` Noam Postavsky
2018-10-06  9:17   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).