Flatten repo
For each git repository (<project> tag) translate name attribute to flatten directory structure. Add path attribute if missing (because checkout hierarchy must be kept). #xml
Start file
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="/home/matt/test-01" name="mirror" review="vimgolf.org"/>
<default remote="mymirror" revision="myandroid-1.2.3"/>
<project name="device/common"/>
<project name="device/generic/common" revision="11c092a6cbfcf6207f07a9a8e3398e747e7f5461"/>
<project groups="pdk" name="device/generic/arm64"/>
<project groups="pdk" name="platform/abi/cpp" path="abi/cpp"/>
<project name="platform/bootable/recovery" path="bootable/recovery"/>
<project name="platform/build" path="build">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="platform/external/bzip2" path="external/bzip2"/>
<project name="kernel/matt-3.18" path="kernel" upstream="myandroid-1.2.4"/>
</manifest>
End file
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="/home/matt/test-01" name="mirror" review="vimgolf.org"/>
<default remote="mymirror" revision="myandroid-1.2.3"/>
<project path="device/common" name="device_common"/>
<project path="device/generic/common" name="device_generic_common" revision="11c092a6cbfcf6207f07a9a8e3398e747e7f5461"/>
<project groups="pdk" path="device/generic/arm64" name="device_generic_arm64"/>
<project groups="pdk" name="platform_abi_cpp" path="abi/cpp"/>
<project name="platform_bootable_recovery" path="bootable/recovery"/>
<project name="platform_build" path="build">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="platform_external_bzip2" path="external/bzip2"/>
<project name="kernel_matt-3.18" path="kernel" upstream="myandroid-1.2.4"/>
</manifest>
View Diff
5,10c5,10
< <project name="device/common"/>
< <project name="device/generic/common" revision="11c092a6cbfcf6207f07a9a8e3398e747e7f5461"/>
< <project groups="pdk" name="device/generic/arm64"/>
< <project groups="pdk" name="platform/abi/cpp" path="abi/cpp"/>
< <project name="platform/bootable/recovery" path="bootable/recovery"/>
< <project name="platform/build" path="build">
---
> <project path="device/common" name="device_common"/>
> <project path="device/generic/common" name="device_generic_common" revision="11c092a6cbfcf6207f07a9a8e3398e747e7f5461"/>
> <project groups="pdk" path="device/generic/arm64" name="device_generic_arm64"/>
> <project groups="pdk" name="platform_abi_cpp" path="abi/cpp"/>
> <project name="platform_bootable_recovery" path="bootable/recovery"/>
> <project name="platform_build" path="build">
13,14c13,14
< <project name="platform/external/bzip2" path="external/bzip2"/>
< <project name="kernel/matt-3.18" path="kernel" upstream="myandroid-1.2.4"/>
---
> <project name="platform_external_bzip2" path="external/bzip2"/>
> <project name="kernel_matt-3.18" path="kernel" upstream="myandroid-1.2.4"/>
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 10 remaining solutions by signing in and submitting your own entry
#11 Igor Czerwinski / @igoratron - Score: 96 - 09/17/17 @ 20:17
5Gqqfny2f"cwpath<Esc>2f"a <C-R>0<Esc>+q2@q:%s<50-53>@name="\zs[^"]*@\=substitute(submatch(0),"/","_","g")<Esc>[201~<CR>ZZ
0 comments