From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Renaming files with git not all that bad? Date: Thu, 9 Dec 2021 12:40:22 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13636"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mathias Dahl , Emacs developers To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 06:42:35 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 1mvCCR-0003Ml-7w for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 06:42:35 +0100 Original-Received: from localhost ([::1]:36068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvCCP-0003Th-F6 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 00:42:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvCAc-0002hP-EF for emacs-devel@gnu.org; Thu, 09 Dec 2021 00:40:42 -0500 Original-Received: from [2607:f8b0:4864:20::a34] (port=42637 helo=mail-vk1-xa34.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvCAV-0003jv-Sz for emacs-devel@gnu.org; Thu, 09 Dec 2021 00:40:42 -0500 Original-Received: by mail-vk1-xa34.google.com with SMTP id s1so3029356vks.9 for ; Wed, 08 Dec 2021 21:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lDO4ZLoNyDnW0I3XCKnfsMoKS5UTrxdoImFTCrYbIN8=; b=jYM7Ook4ZNoOKa2Qh5S2IRp0UsXS79ycUBATe+rKMSPGSAb5Bp7b1NXhzmSVfZjRmx JHoNdc2VJXp0phsc0iNyh0vfSOJsrvAhwIK/kleBtwxjZseL6dxsjiBu2mAcqyB5lEqz NyOH/5lvtDJ8UW4VOTA5wzexXmotPX71xoUuaviPjWodih+A+5PeBgX5utx93oSYJbJK SchHMhE0Yf0ZivCAwXqlEPHnhcjp3TtmWb5yst24IeEuWZXifOUJYy5BOnmg+mKl7c2f mg07g+K6FfzwtcKsnf+vanuVXffo0drTPZuoMTs4alebDi9DCgNWEoTTXtHZDTyDZ+3m sPEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lDO4ZLoNyDnW0I3XCKnfsMoKS5UTrxdoImFTCrYbIN8=; b=m0KhfjsawcPZ/sFTTYhQ462YSrx/Zomq22zJKEwCw7XqIgpqIvmh7YxB9w/artDsnK YB0eXb8azDGJVBuk9CmskR9GmbN+WmctAxmmJQdruWeTWbI0w8yiMgmZtvyFnKbmXrWm LBpSJY1bNnc+GCJieSxkoR9Xe3oqM1zX+Omr2sAt5j3qMcC3e4QmhsGL6t9vteliV73t +6pDluHhNOCzMvJGuCthHFwfPNcVxvMGI518WgQkL/0SB7Q19OkbLAMpYUkxb/d9TFgi joksTUHLwpj0hhSujzyPScOBzZRw+Yv7sE3Mtap5aCzF05jDNLtNV0EiLLT1HIU7mVsw XYMg== X-Gm-Message-State: AOAM532Q4rLjRNnNUK1Es1IOd8IGuCwZheuGXHIZ+fvWPWVXdLeqx2Qf v6yXfsVi3+xavy87iWQv1rinuoPrJvD43z2Zq0AIOr/XyLFJEg== X-Google-Smtp-Source: ABdhPJwt2SRwOtzKmVPRaGRuqHXPvC8c0bpOly3Ytqz2TXm8P5yBbxGo6rzvdppUFVsNPUCx8dMduU3YNa0FLoaNNj4= X-Received: by 2002:a05:6122:50e:: with SMTP id x14mr5941289vko.7.1639028433491; Wed, 08 Dec 2021 21:40:33 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::a34 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::a34; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa34.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:281436 Archived-At: On Thu, 9 Dec 2021 at 10:20, Stefan Kangas wrote: > > The big drawback here is that we will lose the git history. > > I tested this just now, and unless I'm missing something, a rename > actually doesn't have to be all that bad. It turns out that > vc-annotate, magit-blame and vc-region-history have little trouble > handling a rename if its done properly. > > In any case, I made a commit containing no other changes than > > git mv lisp/image-dired.el lisp/image There is also a trick to split a file into multiple parts where each part retains its history. https://devblogs.microsoft.com/oldnewthing/20190916-00/?p=102892 The gist of it is: * From the original point, start multiple branches, one for each part. * On each branch: * Rename the original file to the file name of the target part, and commit just this renaming. * Then, remove the lines that do not belong to this part, and also commit. * Finally, do an octopus merge on all the branches together. This way, each part traces its ancestry to the original file through a rename-only commit.