all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bastian Beischer <bastian.beischer@rwth-aachen.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: David Kastrup <dak@gnu.org>, Emacs-Devel <emacs-devel@gnu.org>,
	monnier@iro.umontreal.ca, dgutov@yandex.ru
Subject: Re: RCS, again: another removed functionality: undo last-checkin
Date: Mon, 21 Sep 2015 12:21:57 +0200	[thread overview]
Message-ID: <CAK9AuB_3fNEaqZ-BxUJyeBSqQXhNERaR4zeT72Ba5ELVO=u6FA@mail.gmail.com> (raw)
In-Reply-To: <83bncwnm67.fsf@gnu.org>

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

Dear all,

I'm not an emacs developer but I'd like to jump in:

As you may know, in git, when a commit is made it consists of these things:

- A complete of snapshot of the file structure of the entire repository and
all file contents
- The commit message, commit time + author time, commiting person
- The SHA1 identifier of the previous commit(s) (there can be multiple in
case of a merge commit)

All of these things enter into the SHA1 identifier of the commit! git has
the tools to change any of the above a posteriori, but it's vital to
understand that any such modification, even if it's just a typo in the
commit message will modify the SHA1 of the commit. The old commit with it's
identifier still exists, but it's 'dangling' i.e. it's typically not part
of the local branch you are working in any more.

Any references to the old identifier of the commit become invalid at that
point!

As long as any such discarded commit was not pushed to a public repository,
it's generally considered fine to do these modifications to your liking.

However, once a commit is pushed out to a public place the situation
changes. People may be using the old ID to refer to that specific commit,
whether you know it or not.

Then, whether you want to allow 'rewriting history' depends entirely on the
conventions in your project - there's no general rule. In emacs you may say
it's OK, even recommened, to modify the staging branch a posteriori in case
a mistake was made. Therefore, it's in general impossible to do the right
thing without knowing the project policy.

In case rewriting history is not possible or wanted, git revert is there to
help you: It simply creates a new commit which applies the reverse patch
with an appropriate commit messate, that's all.

I urge you to read these:

- http://git-scm.com/book/en/v2/Git-Internals-Git-References
- man git rebase (section "RECOVERING FROM UPSTREAM REBASE")
- man git tag (section "DISCUSSION - On Re-tagging")

Best
Bastian


On Mon, Sep 21, 2015 at 11:42 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: David Kastrup <dak@gnu.org>
> > Cc: emacs-devel@gnu.org,  monnier@iro.umontreal.ca,  dgutov@yandex.ru
> > Date: Mon, 21 Sep 2015 10:58:22 +0200
> >
> > >> > OK, but what would you do instead, then, in the case where the
> commit
> > >> > is on "staged", but not yet on master?
> > >>
> > >> You fix staging.
> > >
> > > Fix how?
> >
> > Remove the bad commit from the commit history.  That's what we are
> > talking about the whole time.
> >
> > > This discussion is about the meaning of "rollback" for Git.  So what
> > > I'm trying to figure out is whether there's some Git command other
> > > than "revert" that the user who pushed a bad commit to "staged" should
> > > perform to fix "staging".
> >
> > git reset --hard HEAD~1 in the simplest case.  Or git rebase -i with a
> > selective removal of commits.
>
> Followed by a push, I presume?  IOW, the 'staging" branch permits
> non-FF pushes?
>
> > > then "revert" is still a good interpretation of "rollback", even with
> > > the workflow you describe, because in that workflow the user simply
> > > should not invoke any rollbacks locally.
> >
> > But the usual thing is to "rollback", namely establish the _commit_
> > state from before the bad commit, when encountering a staging-only
> > problem.
> >
> > Git's own development tree has "next", another branch which is
> > frequently being reset rather than have anything reverted in it.  Other
> > projects have similar "tryout" branches.  When you are using branches
> > for proposing patches (like the review tool Gerrit does), you are
> > supposed to _amend_ your proposals so that they look like they've been
> > done correctly right from the start, rather than adding fixes on top.
> > Again, this is rollback territory (or more frequently, git rebase -i
> > territory).  It is only both public and non-ephemeral branches which
> > should not see history changes.
>
> So I guess we will have to provide a way for the user to tell VC which
> branch is of the "revert" type and which is of the "reset" type?
>
>


-- 
Bastian Beischer
RWTH Aachen University of Technology

@RWTH Aachen
Office: 28 C 203
Phone: +49-241-80-27205
E-mail: beischer@physik.rwth-aachen.de
Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen

@CERN
Office: Bdg 32-4-B12
Phone: +41-22-76-75750
E-mail: bastian.beischer@cern.ch
Address: CERN, CH-1211 Geneve 23

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

  parent reply	other threads:[~2015-09-21 10:21 UTC|newest]

Thread overview: 140+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20 14:33 RCS, again: another removed functionality: undo last-checkin Uwe Brauer
2015-09-20 14:51 ` Eli Zaretskii
2015-09-20 14:58   ` Eli Zaretskii
2015-09-20 15:39     ` Uwe Brauer
2015-09-21  3:49       ` Stephen J. Turnbull
2015-09-25  7:53         ` Uwe Brauer
2015-09-20 15:40   ` Uwe Brauer
2015-09-20 16:30 ` Stefan Monnier
2015-09-20 19:59   ` Uwe Brauer
2015-09-20 20:01   ` Uwe Brauer
2015-09-20 23:24   ` Dmitry Gutov
2015-09-21  6:50     ` Eli Zaretskii
2015-09-21  7:25       ` David Kastrup
2015-09-21  7:56         ` Eli Zaretskii
2015-09-21  8:13           ` David Kastrup
2015-09-21  8:16             ` Eli Zaretskii
2015-09-21  8:27               ` David Kastrup
2015-09-21  8:37                 ` Eli Zaretskii
2015-09-21  8:58                   ` David Kastrup
2015-09-21  9:42                     ` Eli Zaretskii
2015-09-21 10:18                       ` David Kastrup
2015-09-21 10:21                       ` Bastian Beischer [this message]
2015-09-22  6:56           ` Richard Stallman
2015-09-22 11:49             ` Stephen J. Turnbull
2015-09-22 22:02               ` Richard Stallman
2015-09-22 22:49                 ` Óscar Fuentes
2015-09-23  6:40                   ` Eli Zaretskii
2015-09-23  7:18                     ` David Kastrup
2015-09-23  8:28                     ` Stephen J. Turnbull
2015-09-23  9:54                       ` Eli Zaretskii
2015-09-23 22:09                   ` Richard Stallman
2015-09-23  5:36                 ` Dmitry Gutov
2015-09-23  6:52                   ` Eli Zaretskii
2015-09-23 13:26                   ` Stefan Monnier
2015-09-23 13:39                     ` Eli Zaretskii
2015-09-23 15:02                       ` Stefan Monnier
2015-09-23 15:13                         ` David Kastrup
2015-09-23 15:31                           ` Andreas Schwab
2015-09-23 14:38                     ` Stephen J. Turnbull
2015-09-23 14:59                     ` Dmitry Gutov
2015-09-23 15:21                       ` Stefan Monnier
2015-09-23 15:27                         ` Dmitry Gutov
2015-09-23 17:33                           ` Stefan Monnier
2015-09-30  2:27                             ` Dmitry Gutov
2015-09-30  4:53                               ` Stefan Monnier
2015-09-30  6:46                                 ` Eli Zaretskii
2015-09-30  8:37                                   ` Stefan Monnier
2015-09-30  8:52                                     ` Eli Zaretskii
2015-09-30 11:35                                       ` Dmitry Gutov
2015-09-30 12:39                                         ` Stefan Monnier
2015-10-01  2:22                                           ` Richard Stallman
2015-10-01  2:32                                             ` Dmitry Gutov
2015-10-02  2:27                                               ` Richard Stallman
2015-10-02  6:37                                                 ` Dmitry Gutov
2015-10-02  7:17                                                   ` Andreas Schwab
2015-10-02  7:38                                                   ` Eli Zaretskii
2015-10-03  1:37                                                   ` Richard Stallman
2015-10-02  6:56                                                 ` Eli Zaretskii
2015-10-03  1:37                                                   ` Richard Stallman
2015-09-30 14:00                                         ` Eli Zaretskii
2015-10-01  2:34                                           ` Dmitry Gutov
2015-10-01  7:06                                             ` Eli Zaretskii
2015-10-01 19:43                                               ` Dmitry Gutov
2015-10-01 19:59                                                 ` Eli Zaretskii
2015-10-01 20:06                                                   ` Dmitry Gutov
2015-10-01 20:12                                                     ` Eli Zaretskii
2015-10-01 20:22                                                       ` Dmitry Gutov
     [not found]                                                         ` <83a8s28gun.fsf@gnu.org>
2015-10-01 21:01                                                           ` Alan Mackenzie
2015-10-01 21:04                                                             ` Dmitry Gutov
2015-10-01 21:01                                                           ` Dmitry Gutov
2015-10-02  6:32                                                             ` Eli Zaretskii
2015-10-02  6:41                                                               ` Dmitry Gutov
2015-10-02  7:39                                                                 ` Eli Zaretskii
2015-09-30 12:38                                       ` Stefan Monnier
2015-10-02  2:27                                         ` Richard Stallman
2015-10-02  2:27                                   ` Richard Stallman
2015-10-02  2:24                                 ` Richard Stallman
2015-10-02  3:34                                   ` Stefan Monnier
2015-10-02  7:11                                     ` Eli Zaretskii
2015-10-02 12:54                                       ` Stefan Monnier
2015-10-02 13:42                                         ` Eli Zaretskii
2015-10-02 14:32                                           ` Dmitry Gutov
2015-10-02 14:40                                             ` Eli Zaretskii
2015-10-02 14:54                                               ` Dmitry Gutov
2015-10-02 14:59                                                 ` Eli Zaretskii
2015-10-02 15:44                                                   ` Stefan Monnier
2015-10-02 16:32                                                   ` Dmitry Gutov
2015-09-30  6:37                               ` Eli Zaretskii
2015-09-30 11:27                                 ` Dmitry Gutov
2015-09-30 14:13                                   ` Eli Zaretskii
2015-10-01  2:47                                     ` Dmitry Gutov
2015-10-01  7:18                                       ` Eli Zaretskii
2015-10-01 12:54                                         ` Dmitry Gutov
2015-10-01 13:07                                           ` Eli Zaretskii
2015-10-01 17:36                                             ` Dmitry Gutov
2015-10-01 17:52                                               ` Eli Zaretskii
2015-10-01 19:29                                                 ` Dmitry Gutov
2015-10-01 19:54                                                   ` Eli Zaretskii
2015-10-01 20:13                                                     ` Dmitry Gutov
2015-10-01 23:55                                               ` Drew Adams
2015-10-02  0:07                                                 ` Dmitry Gutov
2015-10-02  6:16                                                   ` Drew Adams
2015-10-02  2:27                                             ` Richard Stallman
2015-10-02  4:07                                               ` Dmitry Gutov
2015-10-02  4:13                                               ` Dmitry Gutov
2015-09-23 19:03                     ` Uwe Brauer
2015-09-23 22:12                     ` Richard Stallman
2015-09-25  8:29                       ` Uwe Brauer
2015-09-26  1:10                         ` Richard Stallman
2015-09-23 22:10                   ` Richard Stallman
2015-09-25  8:30                     ` Uwe Brauer
2015-09-23  6:37                 ` Eli Zaretskii
2015-09-21 13:13         ` Stefan Monnier
2015-09-21 13:59           ` David Kastrup
2015-09-21 18:39           ` Stefan Monnier
2015-09-21 14:02       ` Dmitry Gutov
2015-09-21 16:07         ` Eli Zaretskii
2015-09-21 16:58           ` Dmitry Gutov
2015-09-21 17:06             ` Eli Zaretskii
2015-09-21 17:24               ` Dmitry Gutov
2015-09-21 19:17                 ` Eli Zaretskii
2015-09-21 19:30                   ` David Kastrup
2015-09-21 19:33                   ` Dmitry Gutov
2015-09-21 19:53                     ` Eli Zaretskii
2015-09-22  0:39                       ` Stephen J. Turnbull
2015-09-22  6:18                         ` Eli Zaretskii
2015-09-22 13:08                       ` Dmitry Gutov
2015-09-22 13:45                         ` Eli Zaretskii
2015-09-22 18:59                           ` Dmitry Gutov
2015-09-22 19:05                             ` Eli Zaretskii
2015-09-23  5:54                               ` Dmitry Gutov
2015-09-23  6:58                                 ` Eli Zaretskii
2015-09-23 14:49                                   ` Dmitry Gutov
2015-09-23 22:08                               ` Richard Stallman
2015-09-21 19:18                 ` Eli Zaretskii
2015-09-22  0:26                   ` Stephen J. Turnbull
2015-09-22  6:16                     ` Eli Zaretskii
2015-09-22 12:32                       ` Stefan Monnier
2015-09-22  6:32                     ` Steinar Bang
2015-09-20 17:09 ` Steinar Bang

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

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

  git send-email \
    --in-reply-to='CAK9AuB_3fNEaqZ-BxUJyeBSqQXhNERaR4zeT72Ba5ELVO=u6FA@mail.gmail.com' \
    --to=bastian.beischer@rwth-aachen.de \
    --cc=dak@gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.