Re: A Method of Breaking Git
On Sun, Oct 29, 2023 at 07:25:38AM +0200, Stijn Tintel wrote: > On 24/10/2023 15:25, Christian Marangi wrote: > > On Tue, Oct 24, 2023 at 02:21:35PM +0200, Bjørn Mork wrote: > >> Christian Marangi 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@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@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. > > > There's another big drawback: it breaks git bisect. In the example > above, if you end up on commit 5a742b351365, the target will try > building kernel 5.15, but there will be no config-5.15. This can happen even without the use of this technique. `git bisect` was designed to handle this type of situation. Simply use `git bisect skip` and everything works. -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+sig...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
On 24/10/2023 15:25, Christian Marangi wrote: On Tue, Oct 24, 2023 at 02:21:35PM +0200, Bjørn Mork wrote: Christian Marangi 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@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@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. There's another big drawback: it breaks git bisect. In the example above, if you end up on commit 5a742b351365, the target will try building kernel 5.15, but there will be no config-5.15. Stijn ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
On Tue, Oct 24, 2023 at 02:21:35PM +0200, Bjørn Mork wrote: > Christian Marangi 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 > Well I've now played with this some and found a fair bit I like, but eventually found some troublesome issues. If one has a patch/commit which was originally against config-5.15 and then rebase onto dup, the patch/commit will successfully move to config-6.1. This is good. If one rebases that after the merge commit, the patch/commit will remain on config-5.15. This is bad. If config-5.15 is removed after the merge commit, and the testing commit is rebased after, it will move to config-6.1. Overall a definite improvement, but certainly not perfect. -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+sig...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
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 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@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@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+sig...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
On Tue, Oct 24, 2023 at 02:21:35PM +0200, Bjørn Mork wrote: > Christian Marangi 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@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@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. -- Ansuel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
Christian Marangi 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@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@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 Bjørn ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
On Tue, Oct 24, 2023 at 01:40:22PM +0200, Bjørn Mork wrote: > Ack on the broken history problem. > > I don't think it's necessary to keep two separate histories though. The > main issue is the periodical removal of files keeping parts of history, > resulting in an increasing number of file names to follow for the > complete history. > > Doing > > git mv config-5.15 config-6.1 > git commit -m 'move Linux 5.15 kernel configuration to Linux 6.1 > configuration' > cp config-6.1 config-5.15 > git commit -m 'resurrect Linux 5.15 kernel configuration' config-5.15 > > would make sure that config-6.1 kept all the history. It results in a > history-less config-5.15, but IMHO that's a minor issue. The point is > to maintain full history attached to one file. The name of this file is > not important. > > The duplicate history attached to the older filename is less > interesting. It will still show changes happening after the split of > course. And you'll most likely start with the "master" history in any > case, and only look at the other file in case there are differences not > explained by that history. > > (Note that two separate commits are required since git is "smart" enough > to detect what happens if you try to squash them) > Also agree that this is a problem. lost of history is problematic and I already had some problem trying to find why something was added Luckly this happen only on kernel bump so not that usual... My problem with the "copy - resurrect" is that we would still lose history (but this time on the old file) and have some bloat with an additional commit... So I would like if there was a better solution 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 -- Ansuel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: A Method of Breaking Git
Ack on the broken history problem. I don't think it's necessary to keep two separate histories though. The main issue is the periodical removal of files keeping parts of history, resulting in an increasing number of file names to follow for the complete history. Doing git mv config-5.15 config-6.1 git commit -m 'move Linux 5.15 kernel configuration to Linux 6.1 configuration' cp config-6.1 config-5.15 git commit -m 'resurrect Linux 5.15 kernel configuration' config-5.15 would make sure that config-6.1 kept all the history. It results in a history-less config-5.15, but IMHO that's a minor issue. The point is to maintain full history attached to one file. The name of this file is not important. The duplicate history attached to the older filename is less interesting. It will still show changes happening after the split of course. And you'll most likely start with the "master" history in any case, and only look at the other file in case there are differences not explained by that history. (Note that two separate commits are required since git is "smart" enough to detect what happens if you try to squash them) Bjørn ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel