threads / discuss / 9857

STG, problem with pop/push of alternative versions of a patch

Subject: STG, problem with pop/push of alternative versions of a patch

## tl;dr

6 messages between Sep 15, 2007 and Sep 15, 2007.

replies: 5people: 2as markdown or json

Jon Smirl· Sep 15, 2007, 03:49 UTC · lore

I trying to test two different versions of a patch that add files. These patches create a new directory and add several files. When I pop a version of the patch the directory and files and not getting removed. This causes an error when I push the alternative version of the patch.

jonsmirl@terra:~/mpc5200b$ stg series
+ 0001-powerpc-exports-rheap-symbol-to-modules.patch
+ 0002-powerpc-Changes-the-config-mechanism-for-rheap.patch
+ 0003-powerpc-ppc32-Update-mpc52xx_psc-structure-with-B-r.patch
+ 0004-powerpc-BestComm-core-support-for-Freescale-MPC5200.patch
+ 0005-powerpc-BestcComm-ATA-task-support.patch
+ 0006-powerpc-BestcComm-FEC-task-support.patch
+ 0007-powerpc-BestcComm-GenBD-task-support.patch
+ ignore-uImage
+ 0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch
+ 0009-sound-Add-support-for-Freescale-MPC5200-AC97-interf.patch
+ 0010-powerpc-In-rheap.c-move-the-EXPORT_SYMBOL-and-use.patch
+ 0011-powerpc-BestComm-move-the-EXPORT_SYMBOL-and-use-th.patch
+ 0012-powerpc-BestComm-ATA-task-move-the-EXPORT_SYMBOL-a.patch
+ 0013-powerpc-BestComm-FEC-task-move-the-EXPORT_SYMBOL-a.patch
+ 0014-powerpc-BestComm-GenBD-task-move-the-EXPORT_SYMBOL.patch
+ 0015-powerpc-BestComm-Replace-global-variable-bcom-by-b.patch
+ 0016-powerpc-Make-the-BestComm-driver-a-standard-of_plat.patch
+ 0017-powerpc-Fix-typo-in-BestComm-ATA-task-support-code.patch
+ 0018-powerpc-BestComm-ATA-task-microcode-insert-copyri.patch
+ 0019-powerpc-BestComm-FEC-task-microcode-insert-copyri.patch
+ 0020-powerpc-BestComm-GenBD-task-microcode-insert-copy.patch
+ 0021-powerpc-Fix-errors-in-bcom-bcom_eng-renaming.patch
+ Makefile
+ pcm030_bsp_powerpc
+ fs_jffs2_use_memcpy_fromio
+ gpio_frame
+ ppc_gpio
+ GPIO-adaption
+ mpc52xx_restart
> pcm_dts_eth_phys
- domen-fec
jonsmirl@terra:~/mpc5200b$ stg pop
0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch..
Checking for changes in the working directory ... done
Popping patches "pcm_dts_eth_phys" -
"0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch" ...
done
Now at patch "ignore-uImage"
jonsmirl@terra:~/mpc5200b$ stg series
+ 0001-powerpc-exports-rheap-symbol-to-modules.patch
+ 0002-powerpc-Changes-the-config-mechanism-for-rheap.patch
+ 0003-powerpc-ppc32-Update-mpc52xx_psc-structure-with-B-r.patch
+ 0004-powerpc-BestComm-core-support-for-Freescale-MPC5200.patch
+ 0005-powerpc-BestcComm-ATA-task-support.patch
+ 0006-powerpc-BestcComm-FEC-task-support.patch
+ 0007-powerpc-BestcComm-GenBD-task-support.patch
> ignore-uImage
- 0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch
- 0009-sound-Add-support-for-Freescale-MPC5200-AC97-interf.patch
- 0010-powerpc-In-rheap.c-move-the-EXPORT_SYMBOL-and-use.patch
- 0011-powerpc-BestComm-move-the-EXPORT_SYMBOL-and-use-th.patch
- 0012-powerpc-BestComm-ATA-task-move-the-EXPORT_SYMBOL-a.patch
- 0013-powerpc-BestComm-FEC-task-move-the-EXPORT_SYMBOL-a.patch
- 0014-powerpc-BestComm-GenBD-task-move-the-EXPORT_SYMBOL.patch
- 0015-powerpc-BestComm-Replace-global-variable-bcom-by-b.patch
- 0016-powerpc-Make-the-BestComm-driver-a-standard-of_plat.patch
- 0017-powerpc-Fix-typo-in-BestComm-ATA-task-support-code.patch
- 0018-powerpc-BestComm-ATA-task-microcode-insert-copyri.patch
- 0019-powerpc-BestComm-FEC-task-microcode-insert-copyri.patch
- 0020-powerpc-BestComm-GenBD-task-microcode-insert-copy.patch
- 0021-powerpc-Fix-errors-in-bcom-bcom_eng-renaming.patch
- Makefile
- pcm030_bsp_powerpc
- fs_jffs2_use_memcpy_fromio
- gpio_frame
- ppc_gpio
- GPIO-adaption
- mpc52xx_restart
- pcm_dts_eth_phys
- domen-fec
jonsmirl@terra:~/mpc5200b$ stg push domen-fec
Checking for changes in the working directory ... done
Pushing patch "domen-fec" ... error: drivers/net/fec_mpc52xx/Kconfig:
already exists in working directory
error: drivers/net/fec_mpc52xx/Makefile: already exists in working directory
error: drivers/net/fec_mpc52xx/fec.c: already exists in working directory
error: drivers/net/fec_mpc52xx/fec.h: already exists in working directory
error: drivers/net/fec_mpc52xx/fec_phy.c: already exists in working directory
fatal: Untracked working tree file 'drivers/net/fec_mpc52xx/Kconfig'
would be overwritten by merge.
  Error: The merge failed during "push".
         Use "refresh" after fixing the conflicts or revert the
operation with "push --undo".
stg push: git-merge-recursive failed with code 128
jonsmirl@terra:~/mpc5200b$ stg push --undo
Undoing push of "domen-fec" ... done
Now at patch "ignore-uImage"
jonsmirl@terra:~/mpc5200b$ stg status
? drivers/net/fec_mpc52xx/
jonsmirl@terra:~/mpc5200b$
-- 
Jon Smirl
jonsmirl@gmail.com
Catalin Marinas· Sep 15, 2007, 08:07 UTC · re: Jon Smirl · lore

Re: STG, problem with pop/push of alternative versions of a patch

On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
Show 5 quoted lines
> I trying to test two different versions of a patch that add files.
> These patches create a new directory and add several files. When I pop
> a version of the patch the directory and files and not getting
> removed. This causes an error when I push the alternative version of
> the patch.

This shouldn't happen AFAICT (at least for the files, as GIT doesn't care much about directories). What GIT/StGIT version are you using? StGIT simply calls GIT to do the HEAD switch.

Could you run 'stg patches drivers/net/fec_mpc52xx/Kconfig' with the initial series pushed? It should show which patches touch this file. If it doesn't show any, maybe the files weren't added to any patch and hence the error.

Thanks.
-- 
Catalin
Jon Smirl· Sep 15, 2007, 14:25 UTC · re: Catalin Marinas · lore

Re: STG, problem with pop/push of alternative versions of a patch

On 9/15/07, Catalin Marinas <catalin.marinas@gmail.com> wrote:
Show 10 quoted lines
> On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> > I trying to test two different versions of a patch that add files.
> > These patches create a new directory and add several files. When I pop
> > a version of the patch the directory and files and not getting
> > removed. This causes an error when I push the alternative version of
> > the patch.
>
> This shouldn't happen AFAICT (at least for the files, as GIT doesn't
> care much about directories). What GIT/StGIT version are you using?
> StGIT simply calls GIT to do the HEAD switch.

I have played around with some more. It is more complicated than the simple case I described. Earlier I noticed a message about applying a patch that was empty that shouldn't have been. I checked and the patch is indeed empty. The empty patch probably caused the files to be left. I had been using hide/unide and reordering with on the patch and had encountered a couple errors in stg. I'll try and track down the sequence that caused the contents of the patch to be lost.

Show 11 quoted lines
>
> Could you run 'stg patches drivers/net/fec_mpc52xx/Kconfig' with the
> initial series pushed? It should show which patches touch this file.
> If it doesn't show any, maybe the files weren't added to any patch and
> hence the error.
>
> Thanks.
>
> --
> Catalin
>
-- 
Jon Smirl
jonsmirl@gmail.com
Catalin Marinas· Sep 15, 2007, 17:31 UTC · re: Jon Smirl · lore

Re: STG, problem with pop/push of alternative versions of a patch

On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
Show 19 quoted lines
> On 9/15/07, Catalin Marinas <catalin.marinas@gmail.com> wrote:
> > On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > I trying to test two different versions of a patch that add files.
> > > These patches create a new directory and add several files. When I pop
> > > a version of the patch the directory and files and not getting
> > > removed. This causes an error when I push the alternative version of
> > > the patch.
> >
> > This shouldn't happen AFAICT (at least for the files, as GIT doesn't
> > care much about directories). What GIT/StGIT version are you using?
> > StGIT simply calls GIT to do the HEAD switch.
>
> I have played around with some more. It is more complicated than the
> simple case I described.  Earlier I noticed a message about applying a
> patch that was empty that shouldn't have been. I checked and the patch
> is indeed empty. The empty patch probably caused the files to be left.
> I had been using hide/unide and reordering with on the patch and had
> encountered a couple errors in stg. I'll try and track down the
> sequence that caused the contents of the patch to be lost.

BTW, you can run 'stg log <patch>' to see how the patch was changed. It even has a -g option to invoke gitk and see each change.

One way a patch could become empty is if the changes it makes are already in the repository (in another patch or merged upstream).

-- 
Catalin
Jon Smirl· Sep 15, 2007, 17:42 UTC · re: Catalin Marinas · lore

Re: STG, problem with pop/push of alternative versions of a patch

On 9/15/07, Catalin Marinas <catalin.marinas@gmail.com> wrote:
Show 26 quoted lines
> On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> > On 9/15/07, Catalin Marinas <catalin.marinas@gmail.com> wrote:
> > > On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > > I trying to test two different versions of a patch that add files.
> > > > These patches create a new directory and add several files. When I pop
> > > > a version of the patch the directory and files and not getting
> > > > removed. This causes an error when I push the alternative version of
> > > > the patch.
> > >
> > > This shouldn't happen AFAICT (at least for the files, as GIT doesn't
> > > care much about directories). What GIT/StGIT version are you using?
> > > StGIT simply calls GIT to do the HEAD switch.
> >
> > I have played around with some more. It is more complicated than the
> > simple case I described.  Earlier I noticed a message about applying a
> > patch that was empty that shouldn't have been. I checked and the patch
> > is indeed empty. The empty patch probably caused the files to be left.
> > I had been using hide/unide and reordering with on the patch and had
> > encountered a couple errors in stg. I'll try and track down the
> > sequence that caused the contents of the patch to be lost.
>
> BTW, you can run 'stg log <patch>' to see how the patch was changed.
> It even has a -g option to invoke gitk and see each change.
>
> One way a patch could become empty is if the changes it makes are
> already in the repository (in another patch or merged upstream).

I was not happy when my patch disappeared. Luckily I had exported it a little while earlier.

This error may have messed up my state and I didn't detect it until later. 0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch is the patch that went missing.

---------- Forwarded message ----------
From: Jon Smirl <jonsmirl@gmail.com>
Date: Sep 13, 2007 4:08 PM
Subject: Stg AssertionError in sink command
To: Git Mailing List <git@vger.kernel.org>, catalin.marinas@gmail.com
Using current git source for Stg

Patch 008 was hidden and I used unhide to bring it back. But the hide/unhide process moved it to the top of the stack. I need to sink it back down to where it came from. Shouldn't hide/unhide preserve the patch position in the stack?

jonsmirl@terra:~/mpc5200b$ stg series
+ 0001-powerpc-exports-rheap-symbol-to-modules.patch
+ 0002-powerpc-Changes-the-config-mechanism-for-rheap.patch
+ 0003-powerpc-ppc32-Update-mpc52xx_psc-structure-with-B-r.patch
+ 0004-powerpc-BestComm-core-support-for-Freescale-MPC5200.patch
+ 0005-powerpc-BestcComm-ATA-task-support.patch
+ 0006-powerpc-BestcComm-FEC-task-support.patch
> 0007-powerpc-BestcComm-GenBD-task-support.patch
- domen-fec
- 0009-sound-Add-support-for-Freescale-MPC5200-AC97-interf.patch
- 0010-powerpc-In-rheap.c-move-the-EXPORT_SYMBOL-and-use.patch
- 0011-powerpc-BestComm-move-the-EXPORT_SYMBOL-and-use-th.patch
- 0012-powerpc-BestComm-ATA-task-move-the-EXPORT_SYMBOL-a.patch
- 0013-powerpc-BestComm-FEC-task-move-the-EXPORT_SYMBOL-a.patch
- 0014-powerpc-BestComm-GenBD-task-move-the-EXPORT_SYMBOL.patch
- 0015-powerpc-BestComm-Replace-global-variable-bcom-by-b.patch
- 0016-powerpc-Make-the-BestComm-driver-a-standard-of_plat.patch
- 0017-powerpc-Fix-typo-in-BestComm-ATA-task-support-code.patch
- 0018-powerpc-BestComm-ATA-task-microcode-insert-copyri.patch
- 0019-powerpc-BestComm-FEC-task-microcode-insert-copyri.patch
- 0020-powerpc-BestComm-GenBD-task-microcode-insert-copy.patch
- 0021-powerpc-Fix-errors-in-bcom-bcom_eng-renaming.patch
- Makefile
- pcm030_bsp_powerpc
- fs_jffs2_use_memcpy_fromio
- gpio_frame
- ppc_gpio
- GPIO-adaption
- mpc52xx_restart
- pcm_dts_eth_phys
- 0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch
jonsmirl@terra:~/mpc5200b$ stg sink -t domen-fec
0008-drivers-net-Add-support-for-Freescale-MPC5200-SoC-i.patch
Checking for changes in the working directory ... done
Traceback (most recent call last):
  File "/usr/local/bin/stg", line 43, in <module>
    main()
  File "/usr/local/lib/python2.5/site-packages/stgit/main.py", line 284, in main
    command.func(parser, options, args)
  File "/usr/local/lib/python2.5/site-packages/stgit/commands/sink.py",
line 58, in func
    crt_series.pop_patch(options.to or oldapplied[0])
  File "/usr/local/lib/python2.5/site-packages/stgit/stack.py", line
1129, in pop_patch
    assert(name in applied)
AssertionError
jonsmirl@terra:~/mpc5200b$
-- 
Jon Smirl
jonsmirl@gmail.com
Catalin Marinas· Sep 15, 2007, 22:44 UTC · re: Jon Smirl · lore

Re: STG, problem with pop/push of alternative versions of a patch

On 15/09/2007, Jon Smirl <jonsmirl@gmail.com> wrote:
> I was not happy when my patch disappeared. Luckily I had exported it a
> little while earlier.

Otherwise, the patch log should be present and it shows each commit id of the patch.

Since we are at this, I think we need a config option to automatically back up (export) the patches. Since StGIT detects whether the patch applied cleanly or it was modified (with a diff3 merge), it only needs to export in a few cases and not affect the performance (diff3 takes significantly longer anyway).

Thanks for reporting this issue.
-- 
Catalin

← back to recent threads