unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Fredrik Nyqvist <fredrik.nyqvist94@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 38343@debbugs.gnu.org
Subject: bug#38343: 27.0.50; vc git: Cannot edit outgoing log (like git commit --amend)
Date: Thu, 28 Nov 2019 21:48:57 +0100	[thread overview]
Message-ID: <CAEhcwWYNdTpGs4eJo7i47ecRhDu9e1y7vkq5agWGyo-WtMHPmw@mail.gmail.com> (raw)
In-Reply-To: <85bba360-2a57-63b8-d82f-3ed7bcd8bee1@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2778 bytes --]

Den ons 27 nov. 2019 kl 23:08 skrev Dmitry Gutov <dgutov@yandex.ru>:

> On 27.11.2019 22:11, Fredrik Nyqvist wrote:
> >
> >
> > Den ons 27 nov. 2019 kl 01:10 skrev Dmitry Gutov <dgutov@yandex.ru
> > <mailto:dgutov@yandex.ru>>:
> >
> >     On 26.11.2019 22:43, Fredrik Nyqvist wrote:
> >      > Den mån 25 nov. 2019 kl 23:49 skrev Dmitry Gutov
> >     <dgutov@yandex.ru <mailto:dgutov@yandex.ru>
> >      > <mailto:dgutov@yandex.ru <mailto:dgutov@yandex.ru>>>:
> >      >
> >      >     On 25.11.2019 22:16, Fredrik Nyqvist wrote:
> >      >      > Yes, I have tried the option you mention to edit the last
> >     commit
> >      >     with
> >      >      > C-x C-e and it is working fine.
> >      >      > But It seems that it only allows amending the last commit
> >     if I have
> >      >      > edited a file.
> >      >
> >      >     Yes. Not sure how to change an arbitrary commit in Git anyway
> >     (without
> >      >     interactive rebase). The best approximation looks like this:
> >      >
> >      > https://stackoverflow.com/a/48999882/615245
> >      >
> >      >
> >      > I am not sure how to do it in a good way either. Maybe the option
> to
> >      > edit an
> >      > older commit message could be skipped for vc-git. And then just
> >     allow amend
> >      > on the latest one.
> >
> >     The question is how to skip. Error in the end, after the user has
> >     already written the new commit message?
> >
> >     Or add a backend predicate action, like "can edit revision ##".
> That's
> >     one more action, though.
> >
> >
> > If the user is trying to edit an older commit message from the
> > log-buffer (with log-view-modify-change-comment) I think an error
> > message is good, before writing the commit message ("can't edit revision
> > ##"). I feel that it will be more clear at least.
>
> Then it seems like we'd also have to introduce a new predicate backend
> action (like "can I edit this revision"). Given a recent discussion with
> our maintainer, I'm not confident we're allowed to do that.
>
> OK I understand.


> > Also we should think about how to handle a commit that has already been
> > pushed. In this case I guess a force push is needed, but maybe that is
> > not good to hide. Maybe it is better to just allow edit on local commits
> > then.
>
> Yeah, it's going to be a choice. Sometimes editing even a commit that's
> been pushed is okay (if it's on a personal branch). We already allow
> doing that with 'C-x C-e', so I'd rather we only gave out a warning
> (with yes-no prompt). The aforementioned predicate could do that job, too.
>

That sounds good to me. At least so that log-view-modify-change-comment
works the same way as 'C-x C-e'.

[-- Attachment #2: Type: text/html, Size: 4218 bytes --]

      reply	other threads:[~2019-11-28 20:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 10:01 bug#38343: 27.0.50; vc git: Cannot edit outgoing log (like git commit --amend) Fredrik Nyqvist
2019-11-25 11:48 ` Dmitry Gutov
2019-11-25 20:16   ` Fredrik Nyqvist
2019-11-25 22:49     ` Dmitry Gutov
2019-11-26 20:43       ` Fredrik Nyqvist
2019-11-27  0:10         ` Dmitry Gutov
2019-11-27 20:11           ` Fredrik Nyqvist
2019-11-27 22:08             ` Dmitry Gutov
2019-11-28 20:48               ` Fredrik Nyqvist [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEhcwWYNdTpGs4eJo7i47ecRhDu9e1y7vkq5agWGyo-WtMHPmw@mail.gmail.com \
    --to=fredrik.nyqvist94@gmail.com \
    --cc=38343@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).