Open Bug 1658817 Opened 4 years ago Updated 1 year ago

Add the ability to skip parents and/or children when applying a patch

Categories

(Conduit :: moz-phab, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: mconley, Assigned: glob)

References

Details

(Keywords: conduit-triaged)

Attachments

(2 files)

I'm working on a patch series that's based on another patch series that another developer is working on. That other developer wants to apply my patches to test something. It'd be nice if they could use moz-phab patch DXXXXX or something to pull down DXXXXX and all of its descendants (but not its parents, which this other developer already has locally).

This is how moz-phab already works - when applying a revision that has children the following prompt is displayed:

Revision D89306 has a child commit.  Would you like to patch the full stack?. (YES/No/Always)?

The wording in the help doesn't make this clear:
--skip-dependencies Do not search for dependencies; patch only one revision

I think things would be clearer if this were:
--no-children Do not apply descendants/children of this patch

Assignee: nobody → glob
Type: defect → enhancement
Keywords: conduit-triaged
Priority: -- → P3
Summary: moz-phab patch should be able to patch a range of commits in a stack → Improve the clarity of moz-phab's behaviour wrt applying children

The latest version of black generates slightly different results than
the older version we were using; bump the version to make it easier for
those with black formatting integrated into their IDE.

Depends on D89384

Hey glob,

I'm not 100% sure this is covering what I mentioned in comment 0. This might make it clearer:

Suppose we have the following patch stack on Phabricator:

D7
D6
D5
D4
D3
D2
D1

Suppose that author A is working on D1-D3, and I'm working on D4-D7.

Now suppose A wants to pull down D4-D5 (but not D1-D3, since they already have those patches locally). I believe the only way to currently do that is:

# Presuming that A has the repository currently updated to the D3 revision
moz-phab patch D4 --skip-dependencies --apply-to here
moz-phab patch D5 --skip-dependencies --apply-to here
moz-phab patch D6 --skip-dependencies --apply-to here
moz-phab patch D7 --skip-dependencies --apply-to here

Is this not true? I'm reasonably certain just doing moz-phab patch D4 --apply-to here will also attempt to apply D1-D3. If that's so, then what would be lovely if if we could do:

moz-phab patch D4:D7 --apply-to here

or have

moz-phab patch D4 --apply-to here

bring the descendants but none of the ancestors.

Argh, re-reading the report now I see where I went wrong; thanks for the clarification.

I think what we need is two new options:
--no-parents → don't bring down ancestors
--no-children → don't bring down descendants

--skip-dependencies would be the same as providing both --no-parents and --no-children; renaming it to --no-dependencies to match all the other options should also be done.

So in your example we'd do mozphab patch D4 --no-parents --apply-to here

Summary: Improve the clarity of moz-phab's behaviour wrt applying children → Add the ability to skip parents when applying a patch
Summary: Add the ability to skip parents when applying a patch → Add the ability to skip parents and/or children when applying a patch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: