Upload
anne-nicolas
View
355
Download
1
Tags:
Embed Size (px)
DESCRIPTION
A presentation of the quilt patch management tool, including use cases (SUSE kernel, OBS) and practical usability tips. Quick presentation of what quilt is, what it can be used for, its most useful commands and what they do 3 typical use cases, step by step Package version update in OBS Patch review as an upstream maintainer Adding a patch to the SUSE kernel Quilt vs Git discussion Known caveats and how to work around them Cool tips: how to get the better of quilt Q&A Jean Delvare, SUSE
Citation preview
Advanced QuiltThat's how it's done!
Jean DELVARELevel 3 Support Engineer
SUSE
2
Advanced Quilt
• Quick introduction to Quilt
• Quilt versus Git
• Practical use cases‒ Patch review as an upstream maintainer
‒ Package version update in OBS
‒ Adding a patch to the SUSE kernel
• Known limitations
• Cool tips
• Q&A
3
Quick introduction to Quilt
Quilt lets you manage a series of patches on top of a working directory. You can:
• Import and remove patches
• Navigate through the series
• Modify patches
• Create new patches anywhere
• Merge patches together
• Export patches in various ways and formats
• And more...
4
Quilt versus Gitor why Quilt still rocks
Developers may think Git made Quilt obsolete:
• Git is very good to store the work once done
• Git is very good to handle huge amounts of data
• Git handles branches very well
• Git makes digging through history very easy‒ Especially if developers have been careful
‒ Which they aren't always
• Quilt is very good for work in progress, when developing, testing or more generally hacking around
Practical use case #1Patch review as an upstream maintainer
Practical use case #2Package version update in OBS
Practical use case #3Adding a patch to the SUSE kernel
8
Known limitations
• Don't forget “quilt add”!‒ Better add more than needed, unchanged files are discarded
automatically
‒ Always use “quilt edit”, it's safer
• Quilt can be slow‒ But I'm working hard to solve the most critical performance
issues
‒ Please report performance issues to me
• ~/.quiltrc takes over system defaults‒ Keep ~/.quiltrc up-to-date
‒ Or source /etc/quilt.quiltrc in ~/.quiltrc
9
Cool tips: get the best out of Quilt!
• Quilt commands can be abbreviated
• All commands print some help with -h
• Use ~/.quiltrc‒ Set QUILT_PATCHES_PREFIX=yes
‒ You can set EDITOR too
‒ Add --color to diff, series, push, patches commands
‒ Set every option you always use for each command
• Quilt now supports a pager, if you like it
10
~/.quiltrc file example
# Global optionsQUILT_PATCHES_PREFIX=yesQUILT_NO_DIFF_INDEX=1QUILT_NO_DIFF_TIMESTAMPS=1QUILT_PAGER=
# Options for external toolsQUILT_DIFF_OPTS="-p"QUILT_PATCH_OPTS="-F 3"
# Default command argumentsQUILT_DIFF_ARGS="--color"QUILT_REFRESH_ARGS="--sort -p ab --diffstat --strip-trailing-whitespace"QUILT_PUSH_ARGS="--color=auto"QUILT_SERIES_ARGS="--color=auto"QUILT_PATCHES_ARGS="--color=auto"
Thank you.
11
Questions?
Corporate HeadquartersMaxfeldstrasse 590409 NurembergGermany
+49 911 740 53 0 (Worldwide)www.suse.com
Join us on:www.opensuse.org
12
Unpublished Work of SUSE LLC. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary and trade secret information of SUSE LLC. Access to this work is restricted to SUSE employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of SUSE. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.
General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. SUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for SUSE products remains at the sole discretion of SUSE. Further, SUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All SUSE marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.
Advanced QuiltThat's how it's done!
Jean DELVARELevel 3 Support Engineer
SUSE
2
Advanced Quilt
• Quick introduction to Quilt
• Quilt versus Git
• Practical use cases‒ Patch review as an upstream maintainer
‒ Package version update in OBS
‒ Adding a patch to the SUSE kernel
• Known limitations
• Cool tips
• Q&A
3
Quick introduction to Quilt
Quilt lets you manage a series of patches on top of a working directory. You can:
• Import and remove patches
• Navigate through the series
• Modify patches
• Create new patches anywhere
• Merge patches together
• Export patches in various ways and formats
• And more...
4
Quilt versus Gitor why Quilt still rocks
Developers may think Git made Quilt obsolete:
• Git is very good to store the work once done
• Git is very good to handle huge amounts of data
• Git handles branches very well
• Git makes digging through history very easy‒ Especially if developers have been careful
‒ Which they aren't always
• Quilt is very good for work in progress, when developing, testing or more generally hacking around
Sometimes I submit a patch upstream, then realize it's not good but the maintainer has already applied it. He/she will ask me for an incremental patch to fix the problem, instead of a replacement patch... because of git! With quilt, a replacement patch would do.
Same for reviewing credits or approvals: often not recorded because the patch was already applied by the maintainer. This kind of discourages reviews.
Sometimes even build breakages end up being fixed by extra patches without rebasing. This is wrong!
Git's ability to work off-line discarded some of Quilt's former use cases, but I believe it is still very useful. And not all software repositories have migrated to Git yet (yes, it's a matter of time...)
Practical use case #1Patch review as an upstream maintainer
# First version received* rename-patch* quilt import ; rm* quilt push* quilt diff | less* ./scripts/checkpatch.pl# Replied with comments ; second version received* quilt snapshot* quilt pop* rename-patch* quilt import* quilt import -f -d n ; rm* quilt push* quilt diff | less* quilt diff –snapshot | less* quilt snapshot -d# Patch accepted
Practical use case #2Package version update in OBS
Practical use case #3Adding a patch to the SUSE kernel
“quilt annotate” can also be demonstrated at this point.
8
Known limitations
• Don't forget “quilt add”!‒ Better add more than needed, unchanged files are discarded
automatically
‒ Always use “quilt edit”, it's safer
• Quilt can be slow‒ But I'm working hard to solve the most critical performance
issues
‒ Please report performance issues to me
• ~/.quiltrc takes over system defaults‒ Keep ~/.quiltrc up-to-date
‒ Or source /etc/quilt.quiltrc in ~/.quiltrc
Emacs has a plug-in that can call “quilt add” for you.You can also make your tree read-only.Also make sure you run the first “quilt new” or “quilt import” at the root of your working directory.Performance is limited by the fact that Quilt is implemented as bash scripts, but it doesn't mean improvements aren't possible. For example I recently improved the “quilt series” command, which took over 3 minutes on the SLE11 SP3 kernel before and now takes under a second. We are really pushing Quilt to its limits with the SLE11 SP3 kernel tree which has over 15,000 patches!
9
Cool tips: get the best out of Quilt!
• Quilt commands can be abbreviated
• All commands print some help with -h
• Use ~/.quiltrc‒ Set QUILT_PATCHES_PREFIX=yes
‒ You can set EDITOR too
‒ Add --color to diff, series, push, patches commands
‒ Set every option you always use for each command
• Quilt now supports a pager, if you like it
I've not typed “quilt refresh” or “quilt previous” in years.~/.quiltrc is a bash script, you can use shell constructs.Colors can be adjusted if needed.
10
~/.quiltrc file example
# Global optionsQUILT_PATCHES_PREFIX=yesQUILT_NO_DIFF_INDEX=1QUILT_NO_DIFF_TIMESTAMPS=1QUILT_PAGER=
# Options for external toolsQUILT_DIFF_OPTS="-p"QUILT_PATCH_OPTS="-F 3"
# Default command argumentsQUILT_DIFF_ARGS="--color"QUILT_REFRESH_ARGS="--sort -p ab --diffstat --strip-trailing-whitespace"QUILT_PUSH_ARGS="--color=auto"QUILT_SERIES_ARGS="--color=auto"QUILT_PATCHES_ARGS="--color=auto"
Thank you.
11
Questions?
Corporate HeadquartersMaxfeldstrasse 590409 NurembergGermany
+49 911 740 53 0 (Worldwide)www.suse.com
Join us on:www.opensuse.org
12
Unpublished Work of SUSE LLC. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary and trade secret information of SUSE LLC. Access to this work is restricted to SUSE employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of SUSE. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.
General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. SUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for SUSE products remains at the sole discretion of SUSE. Further, SUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All SUSE marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.