From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luke Lee Newsgroups: gmane.emacs.devel Subject: Re: Please don't obsolete "crisp.el" Date: Mon, 14 Jul 2014 18:29:30 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1caa298ac3604fe24c6bb X-Trace: ger.gmane.org 1405333832 28401 80.91.229.3 (14 Jul 2014 10:30:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jul 2014 10:30:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 14 12:30:22 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X6dWX-0006ct-8A for ged-emacs-devel@m.gmane.org; Mon, 14 Jul 2014 12:30:21 +0200 Original-Received: from localhost ([::1]:55756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6dWW-0001un-Q4 for ged-emacs-devel@m.gmane.org; Mon, 14 Jul 2014 06:30:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6dWR-0001uA-Se for emacs-devel@gnu.org; Mon, 14 Jul 2014 06:30:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6dWQ-0000il-BA for emacs-devel@gnu.org; Mon, 14 Jul 2014 06:30:15 -0400 Original-Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:55400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6dWO-0000hE-2A; Mon, 14 Jul 2014 06:30:12 -0400 Original-Received: by mail-pa0-f48.google.com with SMTP id bj1so1724017pad.21 for ; Mon, 14 Jul 2014 03:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KpH5vSyjj9sYvZrHvtkpPi/Z8PYRRxyLVdIe24+3hPc=; b=XGxs3Bc+XvPN98FDDLHyJAvCkkF0/9fKLohxJ/u7axtkUVktZnLrC9OUmdrNjW928Q TNogllxLhaBFyUPeTz0IEiDKOCui7dqXXcxtO24ur6sCMlV+l3W/HNkdZCtIMsvcF3wE 9I9YLp7E+3bEEg0d/ahCg16PSzjgXkf3ndTs9CfqM1/whnTKad9/nm4cAAveBgXWQe/i Xqjb7isoctJO33uLS1vZM2+ul8wnyi1mizY+tUBrU8UqReaigh7ltykheJMVScU+bTaQ room2dZxK7n6XR7kjCv6nV8B2saRum5EPc240AvXAOQMsrUy2g9LoMD1BemNrl/Cqh7c O6Sw== X-Received: by 10.66.131.39 with SMTP id oj7mr15851270pab.20.1405333811013; Mon, 14 Jul 2014 03:30:11 -0700 (PDT) Original-Received: by 10.70.89.165 with HTTP; Mon, 14 Jul 2014 03:29:30 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173023 Archived-At: --001a11c1caa298ac3604fe24c6bb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> However, the bad thing is that we can't add "--reverse" to reverse the > > Why not? I should said "it failed". It showed only the last commit. I guess there is a bug in git that fail to reverse the history when crisp.el moved from emulation/ to obsolete/. If we don't add --reverse then it worked perfectly. >> Another bad thing about "git am" is that it will commit "on top of" current >> commit so we'll see a history like the following using "git log": > > So, you want to create a brand new empty branch in which you apply the > patches and then you merge that branch into `elpa'. Yes, I did tried a few similar methods to create a new branch or remote repo, before my last email was sent. But anything related to "git am" did not work -- there is always a 2014 back to 1997 commit in the history. Today I tried again and finally find out the correct parameter: the key to success is: git am --committer-date-is-author-date ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Before that, only the "filter-branch" method don't have such a reversing histroy issue. Now we can proceed on using "git am". > Stefan "Still believes =C2=ABtoo much hassle for too little benef= it=C2=BB" For me, using git is just like using Emacs, a never ending story of learning. So it's always worth it for me to explore more. IMHO, the only reason to justify this is, like Glenn said, moving one package from Emacs to ELPA did not happen before. So I think it should be worth it to try some experiments till a proper sequence appears. So that in the future people could have a procedure to follow -- without too much effort but stil= l able to produce acceptable result. Here I conclude my steps to move crisp.el's history from Emacs to ELPA. Fee= l free to adjust the steps for landmark.el: 1. Preparing crisp.el history in Emacs repository: 1.1. "cd emacs.git" 1.2. "git log --follow --name-status lisp/obsolete/crisp.el" # We saw crisp.el moved from emulation/ to obsolete/ in the beginning, # Say we tag this commit ID as "last-crisp" 1.3. Create a big patch from lisp/emulation: "git log -p --pretty=3Demail --reverse --follow lisp/emulation/crisp.el > cirsp-history.patch" # Here I saw 56 commits in this big patch (1.4) Mangle the commit messages in crisp-history.patch to notify these commits comes from Emacs repo. 2. Import crisp.el history into ELPA repository: 2.1. Clone an ELPA to "elpa.crisp" directory 2.2. "cd elpa.crisp" 2.3. Create a new branch with no commits: "git checkout --orphan crisp-in-emacs" 2.4. Remeber to delete everything for later "git am" to success: "git reset --hard" 2.5. Import the commit history that we just created, keeping the correc= t commit date/time: "git am --committer-date-is-author-date ../emacs.git/crisp-history.patch" 2.6. During the process git will pause several times for failing apply the patches. We need to manually fix them. I found all those patch failure are about the copyright message chagne. So I just manually applied the changes and do "git am --continue" to keep going, or do "git am --skip" if those changes are already in place. 2.7. Now we've the latest Emacs crisp.el in ELPA/lisp/emulation, now move it to a new package dir: "git mv lisp/emulation/crisp.el package/crisp-mode" "git commit -m 'Move crisp-mode from Emacs trunk to ELPA'" 2.8. Now we're ready to merge it back to master: "git checkout master" 2.9. "git merge crisp-in-emacs" with commit message "Merge crisp-mode package from Emacs repository" We're done. Now examine the repository history. (2.10) (Not done yet) Now push it back with "git push ...". If everyone is okay with that, I'll commit the merge. Of course, before I did that we should have a proper message prefix/postfix the commit messages fro= m Emacs trunk, to prevent confusing ELPA existing commit log (i.e. the above skipped step 1.4). Thanks. Luke Lee. --001a11c1caa298ac3604fe24c6bb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>> However, the bad thing is that we can't add &= quot;--reverse" to reverse the
>
> Why not?

I shoul= d said "it failed". It showed only the last commit. I guess there= is a
bug in git that fail to reverse the history when crisp.el moved from emulat= ion/
to obsolete/. If we don't add --reverse then it worked perfectl= y.

>> Another bad thing about "git am" is that it wi= ll commit "on top of" current
>> commit so we'll see a history like the following using "g= it log":
>
> So, you want to create a brand new empty bran= ch in which you apply the
> patches and then you merge that branch in= to `elpa'.

Yes, I did tried a few similar methods to create a new branch or remote= repo,
before my last email was sent. But anything related to "git = am" did not work --
there is always a 2014 back to 1997 commit in t= he history. Today I tried again
and finally find out the correct parameter: the key to success is:

= =C2=A0=C2=A0 git am --committer-date-is-author-date <crisp-patches>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^

Before that, only the "filter-branch" method= don't have such a reversing
histroy issue. Now we can proceed on using "git am".

>= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Stefan "Still believe= s =C2=ABtoo much hassle for too little benefit=C2=BB"

For me, u= sing git is just like using Emacs, a never ending story of learning.
So it's always worth it for me to explore more.

IMHO, the only r= eason to justify this is, like Glenn said, moving one package
from Emacs= to ELPA did not happen before. So I think it should be worth it to
try some experiments till a proper sequence appears. So that in the future<= br>people could have a procedure to follow -- without too much effort but s= till
able to produce acceptable result.

Here I conclude my steps = to move crisp.el's history from Emacs to ELPA. Feel
free to adjust the steps for landmark.el:

1. Preparing crisp.el hist= ory in Emacs repository:
=C2=A0=C2=A0 1.1.=C2=A0 "cd emacs.git"= ;

=C2=A0=C2=A0 1.2.=C2=A0 "git log --follow --name-status lisp/= obsolete/crisp.el"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # We saw crisp.el moved fr= om emulation/ to obsolete/ in the beginning,
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 # Say we tag this commit ID as "last-crisp"=

=C2=A0=C2=A0 1.3.=C2=A0 Create a big patch from lisp/emulation:
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "git log -p --pretty= =3Demail --reverse --follow lisp/emulation/crisp.el
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > cirsp-history.p= atch"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # Here I saw= 56 commits in this big patch

=C2=A0=C2=A0 (1.4) Mangle the commit m= essages in crisp-history.patch to notify these
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 commits comes from Emacs repo.

2. Import crisp.el history into ELPA repository:
=C2=A0=C2=A0 2.1.= =C2=A0 Clone an ELPA to "elpa.crisp" directory

=C2=A0=C2= =A0 2.2.=C2=A0 "cd elpa.crisp"

=C2=A0=C2=A0 2.3.=C2=A0 Cre= ate a new branch with no commits:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 "git checkout --orphan crisp-in-emacs"

=C2=A0=C2=A0 2.4.=C2=A0 Remeber to delete everything for later "gi= t am" to success:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = "git reset --hard"

=C2=A0=C2=A0 2.5.=C2=A0 Import the comm= it history that we just created, keeping the correct
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 commit date/time:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "git am --committer-date-is= -author-date ../emacs.git/crisp-history.patch"

=C2=A0=C2=A0 2.6= .=C2=A0 During the process git will pause several times for failing apply t= he
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 patches. We need to = manually fix them. I found all those patch failure
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 are about the copyright me= ssage chagne. So I just manually applied the
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 changes and do "git am --continue" to keep = going, or do "git am --skip"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 if those changes are already in place.

=C2=A0=C2=A0 2.7.=C2=A0 Now we've the latest Emacs crisp.el in ELPA= /lisp/emulation, now move it
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 to a new package dir:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 "git mv lisp/emulation/crisp.el package/crisp-mode"
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "git commit -m 'Move= crisp-mode from Emacs trunk to ELPA'"

=C2=A0=C2=A0 2.8.=C2=A0 Now we're ready to merge it back to master:=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "git checkout mas= ter"

=C2=A0=C2=A0 2.9.=C2=A0 "git merge crisp-in-emacs&quo= t;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 with commit message<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Merge crisp-mode = package from Emacs repository"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 We're done. Now examin= e the repository history.

=C2=A0=C2=A0 (2.10) (Not done yet) Now pus= h it back with "git push ...".

If everyone is okay with th= at, I'll commit the merge. Of course, before I did
that we should have a proper message prefix/postfix the commit messages fro= m
Emacs trunk, to prevent confusing ELPA existing commit log (i.e. the a= bove
skipped step 1.4).

Thanks.
Luke Lee.

--001a11c1caa298ac3604fe24c6bb--