Skip to content

Add guards to guilt

Eric Lesh git 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 10 repliesIn review
  2. v14 patches 15 repliesSuperseded

Changes in v2 from the cover letter

- get_series returns guarded series, get_full_series gives full series. Most commands want the guarded series anyway.
- more options for guilt-select (better hg compatability)
- rename guilt-guards to guilt-guard (better hg compatability)
- a couple bug fixes
- an extra patch that adds a test suite

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5get_series: Remove comments from end of series linesguilt regression/050-series.sh+13 -41 reply
2/5guilt-guard: Assign guards to patches in seriesDocumentation/guilt-guard.txt guilt guilt-guard+175 -08 replies
3/5guilt-select: Select guards to apply when pushing patchesDocumentation/guilt-select.txt Documentation/guilt.txt guilt +1 more+104 -10 replies
4/5get_series: return guarded patches onlyguilt guilt-export guilt-guard +4 more+16 -140 replies
5/5Guards test suiteregression/070-guards.sh+184 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [GUILT PATCH v2 0/5] Add guards to guilt

Changes in v2
- get_series returns guarded series, get_full_series gives full series. Most commands want the guarded series anyway.
- more options for guilt-select (better hg compatability)
- rename guilt-guards to guilt-guard (better hg compatability)
- a couple bug fixes
- an extra patch that adds a test suite

This series adds Mercurial Queues-like guards to guilt. It allows you to assign guards to related patches in the series file to selectively push patches.

See Chapter 13 of the HG Book for more info.
(http://hgbook.red-bean.com/hgbookch13.html)

Guards are appended as "#+foo" or "#-foo" to the end of the patch name in the series file, so they are compatible with quilt. The guard setting and unsetting functions also respect comments on the patch line, so they aren't mangled when you use guards.

This changes get_series to return the guarded series of patches that will be actually be applied. get_full_series returns the full series file.

If you change guards on a patch or select a different guard while patches are applied, some commands might get confused. See guilt-select --pop and guilt-select --reapply to avoid having to guilt-pop -a yourself.

I did everything (maybe?) you suggested except implement a safe_sed wrapper and a validate_guards function. The sed stuff is maybe better for a later patch that covers most sed usage in guilt, and the validate_guards isn't really necessary given the small number of times it's called. If you would prefer either of those to get done, let me know.

[PATCH 1/5] get_series: Remove comments from end of series lines
This just strips everything but the patch name from get_series, to hide comments or guards on the line.

[PATCH 2/5] guilt-guard: Assign guards to patches in series
This adds the guilt-guard command and utility functions to guilt. Introduces get_guarded_series, which is removed in patch 4.

[PATCH 3/5] guilt-select: Select guards to apply when pushing patches
This puts selected guards in .git/patch/$branch/guards, and adds a $guards_file variable to guilt.

[PATCH 4/5] get_series: return guarded patches only
Actually distinguish between guarded and non-guarded patches in a number of commands by making get_series return the guarded series, and introducing get_full_series to return the unguarded series. Lots of changes.
If anything breaks, it's in this patch. Hopefully.

[PATCH 5/5] Guards test suite
Test stuff that uses get_series or get_full_series.