lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] valyuta/005 7454e60 4/6: Import various improvem


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] valyuta/005 7454e60 4/6: Import various improvements from 'master'
Date: Mon, 25 Jan 2021 19:10:43 +0100

On Mon, 25 Jan 2021 17:51:45 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> On 1/25/21 5:30 PM, Vadim Zeitlin wrote:
GC> > On Mon, 25 Jan 2021 12:11:02 -0500 (EST) Greg Chicares 
<gchicares@sbcglobal.net> wrote:
GC> > 
GC> > GC> branch: valyuta/005
GC> > GC> commit 7454e60867ca84c755bdec1c23bce3ebe93bc263
GC> > GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> > GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> > GC> 
GC> > GC>     Import various improvements from 'master'
GC> > GC>     
GC> > GC>     This "merge" was done manually, without git-merge, because 
repeating
GC> > GC>     minor changes was a good way to make sure they're correct and 
complete.
GC> > 
GC> >  Just FYI, it's quite possible to do such merges manually while still
GC> > recording them as a merge for Git (i.e. a commit with 2 parents) in order
GC> > to make automatic merges (or many other operations, such as git-blame) 
work
GC> > correctly in the future.
GC> 
GC> How? I looked for a hypothetical 'git-merge --patch' but found nothing.

 The simplest is to do "git merge --no-commit", then "git reset HEAD" (with
whichever options you prefer to use) and edit the working tree contents
manually to your satisfaction, then "git add" and "git commit" as usual.

 Generally speaking you have the total liberty of synthesizing any commits
you want using Git low-level interface, i.e. git-commit-tree can be used to
create a commit from a tree and the associated meta information (including
the commit message and the commit parents) and git-write-tree can be used
to create a tree from the current index contents. So, basically, as long as
you can get the desired data into the index, either in the usual way, i.e.
by editing the files in the working directory and then using git-add, or by
using git-read-tree (and then tweaking it if necessary), you can create a
commit with this data and any parent(s) that you want.

 This can be surprisingly useful, the mini-series of posts by Raymond Chen
contains some instructive examples, see the following links, in order:

https://devblogs.microsoft.com/oldnewthing/20190506-00/?p=102478
https://devblogs.microsoft.com/oldnewthing/20190507-00/?p=102480
https://devblogs.microsoft.com/oldnewthing/20190508-00/?p=102482
https://devblogs.microsoft.com/oldnewthing/20190509-00/?p=102485
https://devblogs.microsoft.com/oldnewthing/20190510-00/?p=102488
https://devblogs.microsoft.com/oldnewthing/20190513-00/?p=102490
https://devblogs.microsoft.com/oldnewthing/20190514-00/?p=102493
https://devblogs.microsoft.com/oldnewthing/20190515-00/?p=102495

 Regards,
VZ

Attachment: pgpUdvjYdWceF.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]