From 9622ab417325c6d60f5e9e95f4e3786bf6f0e2d5 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 21 Jun 2021 15:53:39 -0400 Subject: Reimplement --guess-base Based on some feedback, attempt to reimplement --guess-base by looking at the file index hashes and using --find-object to locate when they were last changed. We limit this using --since and --until, so that we aren't trying to look through the entire history of the repo. For the --until date, we take the date of the patch. For the --since date, we take the timedelta using the number of days specified by --guess-lookback (default is 14 days). Signed-off-by: Konstantin Ryabitsev --- b4/command.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'b4/command.py') diff --git a/b4/command.py b/b4/command.py index 2d6994d..ebbb361 100644 --- a/b4/command.py +++ b/b4/command.py @@ -120,6 +120,10 @@ def cmd(): '"-P *globbing*" to match on commit subject)') sp_am.add_argument('-g', '--guess-base', dest='guessbase', action='store_true', default=False, help='Try to guess the base of the series (if not specified)') + sp_am.add_argument('-b', '--guess-branch', dest='guessbranch', default='HEAD', + help='When guessing base, use this branch instead of HEAD (use with -g)') + sp_am.add_argument('--guess-lookback', dest='guessdays', type=int, default=14, + help='When guessing base, go back this many days from the date of the patch') sp_am.add_argument('-3', '--prep-3way', dest='threeway', action='store_true', default=False, help='Prepare for a 3-way merge ' '(tries to ensure that all index blobs exist by making a fake commit range)') -- cgit v1.2.3