From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Renaming files with git not all that bad? Date: Fri, 10 Dec 2021 13:28:01 +0100 Message-ID: <877dcceiko.fsf@gnu.org> References: <878rwuia7g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20567"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.5; emacs 29.0.50 Cc: Mathias Dahl , emacs-devel@gnu.org, Yuri Khan To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 10 13:46:53 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvfIZ-000587-W5 for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Dec 2021 13:46:52 +0100 Original-Received: from localhost ([::1]:51412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvfIX-0003Fh-3h for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Dec 2021 07:46:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvfFU-0001lF-CN for emacs-devel@gnu.org; Fri, 10 Dec 2021 07:43:40 -0500 Original-Received: from [2001:470:142:3::e] (port=41062 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvfFT-0003GK-Rq; Fri, 10 Dec 2021 07:43:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=wsl/ZvjVRrOx48DtrDFlo9fegnxeNm4T3olDnfYLzOc=; b=GFJLEYbAuB5t+D ZGEmU+t1bBQrBGTSAb+XPobXUv7s+nfKmZCCwBthRCM4DJo6S4VKKCEWyK6xhXyf+N5B9t+RKqU9n C86INy5FiwYeUyDcElswuIoHCidF//wfNH8tvaO5ziEhUz0sa91rKIjXn1rQXFCPJdmrD0fWjsf7Z Lf1dluh7M7Vk6JZ3I9rg0rB3qNFZ1A4NkoMvtKltNUGO03nnxW+V0PVMLxohX4Rso3ByEOxtSsCBQ PDlYpSedOFvq8OHdYryGAZikup9lit+gd03Yun7ec2NEEsNtaIVmPfbkJUwHBC1Uxf1A0AiJqN1kj mAbdr3mtpk21uFM6pwqg==; Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:42595) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvfFT-0006de-KJ; Fri, 10 Dec 2021 07:43:39 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 9FBB327C005A; Fri, 10 Dec 2021 07:43:38 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 10 Dec 2021 07:43:38 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkedvgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffuffgjkfggtgfgsehtqhertddtreejnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepie dugffhhfejveevvdfhffegteelleejffefgefgueeggeelheefieeujefhheegnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Dec 2021 07:43:37 -0500 (EST) In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281590 Archived-At: Stefan Kangas writes: Hi Stefan, >>> Couldn't the same effect be achieved in a simpler manner by copying the >>> original file N times in one commit and then stripping the copies and >>> original down to what they should eventually become? (AFAIK, git has no >>> problem detecting literal copies.) >> >> Indeed, I tried this and it works for me, as long as the first commit >> is only literal copies. Maybe Git=E2=80=99s ancestry detection through c= opies >> was not as advanced in the unspecified times when Raymond invented >> his technique. > > I'm having no luck with this. > > Could you describe the exact steps you took? I've just tried: git checkout -b copy-test cp lisp/image-dired.el lisp/image-dired-1.el cp lisp/image-dired.el lisp/image-dired-2.el git add lisp/image-dired-*.el git commit -m "copied image-dired.el twice" Thereafter, git log -- lisp/image-dired-1.el lisp/image-dired-2.el show only my "copied image-dired.el twice" commit unless I also specify --follow. I've also tried the "multiple renames on different branches followed by an octopus merge" strategy but the result looks identical. Oh, no, not quite. It's the same wrt. "git log" but the difference is that with the copy strategy, "git blame" will show you as having touched all lines during the copy (which is sensible somehow) whereas they keep the original previous last authors with the renaming strategy. One problem with the renaming strategy is that the original file is inevitably renamed after the merge, or at least you have to have one branch in the merge where it is modified in the hope to get a conflict so that you can keep all renamed versions and the original. However, since you want to move all image-dired related files into their own directory, that's no problem whatsoever. Bye, Tassilo