A Method of Breaking Git

Elliott Mitchell ehem+openwrt at m5p.com
Tue Oct 24 17:28:53 PDT 2023


On Tue, Oct 24, 2023 at 02:25:06PM +0200, Christian Marangi wrote:
> On Tue, Oct 24, 2023 at 02:21:35PM +0200, Bjørn Mork wrote:
> > Christian Marangi <ansuelsmth at gmail.com> writes:
> > 
> > > Anyway I have also found this [1]... if it does actually works, it might be
> > > THE solution to our specific problem. Wonder if someone can test it on a
> > > sample repository.
> > >
> > > [1] https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904
> > 
> > Nice!  Seems to work.  Tried this in an almost uptodate OpenWrt main
> > branch:
> > 
> >    git checkout -b dup
> >    git mv target/linux/ramips/mt7621/config-5.15 target/linux/ramips/mt7621/config-6.1
> >    git commit -s -m 'create config-6.1 based on config-5.15'
> >    git checkout HEAD~  target/linux/ramips/mt7621/config-5.15
> >    git commit -s -m 'restore config-5.15'
> >    git checkout -
> >    git merge --no-ff dup
> > 
> > and ended up with
> > 
> >  bjorn at canardo:/usr/local/src/openwrt$ git log --oneline --follow -n 5 target/linux/ramips/mt7621/config-5.15
> >  6e91f43c99a7 (dup) restore config-5.15
> >  5a742b351365 create config-6.1 based on config-5.15
> >  cd2b74e01e8d ramips: mt7621: disable highmem support and remove highmem offset patch
> >  39b2251cd972 treewide: remove CONFIG_FRAME_WARN from kernel configs
> >  dc38199b96ee ramips/mt7621: disable the cpufreq driver
> > 
> >  bjorn at canardo:/usr/local/src/openwrt$ git log --oneline --follow -n 5 target/linux/ramips/mt7621/config-6.1 
> >  5a742b351365 create config-6.1 based on config-5.15
> >  cd2b74e01e8d ramips: mt7621: disable highmem support and remove highmem offset patch
> >  39b2251cd972 treewide: remove CONFIG_FRAME_WARN from kernel configs
> >  dc38199b96ee ramips/mt7621: disable the cpufreq driver
> >  958fdf36e35c generic: mt7530: backport support for the MT7988 built-in switch
> > 
> > 
> > Best solution so far
> 
> Yep only drawback is the additional commit and the merge commit but this
> might be the only case where we can accept a merge commit. Might be
> worth to document this in the wiki if we take a decision on this.

Ironically I was thinking about solutions involving moves and merges as
a potential method to reconstruct functional histories for the config
files.  All of these proposed strategies appear to successfully
accomplish the task of keeping history attached to the configuration
files.

Some of the generic patches may be worthy of similar treatment.  The
history for the hack patches might be valuable.  Likely the two bring-up
steps could be done and they could share a single merge commit.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg at m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





More information about the openwrt-devel mailing list