From: Junio C Hamano <gitster@pobox.com>
To: Joel Holdsworth <jholdsworth@nvidia.com>
Cc: git@vger.kernel.org,
Tzadik Vanderhoof <tzadik.vanderhoof@gmail.com>,
Dorgon Chang <dorgonman@hotmail.com>,
Joachim Kuebart <joachim.kuebart@gmail.com>,
Daniel Levin <dendy.ua@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Luke Diamand <luke@diamand.org>, Ben Keene <seraphire@gmail.com>,
Andrew Oakley <andrew@adoakley.name>
Subject: Re: [PATCH v2 2/2] git-p4: remove "rollback" verb
Date: Mon, 20 Dec 2021 11:32:04 -0800 [thread overview]
Message-ID: <xmqqlf0fvzrf.fsf@gitster.g> (raw)
In-Reply-To: <20211217140547.2115095-3-jholdsworth@nvidia.com> (Joel Holdsworth's message of "Fri, 17 Dec 2021 14:05:47 +0000")
Joel Holdsworth <jholdsworth@nvidia.com> writes:
> The git-p4 "rollback" verb is described as "A tool to debug the
> multi-branch import. Don't use :)".
;-).
> The implementation provided is of no
> useful benefit to either users or developers.
It is hard to make such a broad "no useful benefit" claim without
giving a bit more analysis [*]. With only that single sentence, it
is far worse justification than saying that "The author tells us not
to use it, and it is not even documented" to convince others why
removal is a good idea.
I'd suggest dropping that sentence (replace it with something we can
objectively verify, like "it is not even documented", if you want to).
Thanks.
[Footnote]
* what the code tried to do, how it didn't do it well that it was
clear that it couldn't possibly be useful, etc. etc.
> Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
> ---
> Adds Signed-off-by tag
>
> git-p4.py | 60 -------------------------------------------------------
> 1 file changed, 60 deletions(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index b7ed8e41ff..a7cb321f75 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -1532,65 +1532,6 @@ def loadUserMapFromCache(self):
> except IOError:
> self.getUserMapFromPerforceServer()
>
> -class P4RollBack(Command):
> - def __init__(self):
> - Command.__init__(self)
> - self.options = [
> - optparse.make_option("--local", dest="rollbackLocalBranches", action="store_true")
> - ]
> - self.description = "A tool to debug the multi-branch import. Don't use :)"
> - self.rollbackLocalBranches = False
> -
> - def run(self, args):
> - if len(args) != 1:
> - return False
> - maxChange = int(args[0])
> -
> - if "p4ExitCode" in p4Cmd("changes -m 1"):
> - die("Problems executing p4");
> -
> - if self.rollbackLocalBranches:
> - refPrefix = "refs/heads/"
> - lines = read_pipe_lines("git rev-parse --symbolic --branches")
> - else:
> - refPrefix = "refs/remotes/"
> - lines = read_pipe_lines("git rev-parse --symbolic --remotes")
> -
> - for line in lines:
> - if self.rollbackLocalBranches or (line.startswith("p4/") and line != "p4/HEAD\n"):
> - line = line.strip()
> - ref = refPrefix + line
> - log = extractLogMessageFromGitCommit(ref)
> - settings = extractSettingsGitLog(log)
> -
> - depotPaths = settings['depot-paths']
> - change = settings['change']
> -
> - changed = False
> -
> - if len(p4Cmd("changes -m 1 " + ' '.join (['%s...@%s' % (p, maxChange)
> - for p in depotPaths]))) == 0:
> - print("Branch %s did not exist at change %s, deleting." % (ref, maxChange))
> - system("git update-ref -d %s `git rev-parse %s`" % (ref, ref))
> - continue
> -
> - while change and int(change) > maxChange:
> - changed = True
> - if self.verbose:
> - print("%s is at %s ; rewinding towards %s" % (ref, change, maxChange))
> - system("git update-ref %s \"%s^\"" % (ref, ref))
> - log = extractLogMessageFromGitCommit(ref)
> - settings = extractSettingsGitLog(log)
> -
> -
> - depotPaths = settings['depot-paths']
> - change = settings['change']
> -
> - if changed:
> - print("%s rewound to %s" % (ref, change))
> -
> - return True
> -
> class P4Submit(Command, P4UserMap):
>
> conflict_behavior_choices = ("ask", "skip", "quit")
> @@ -4353,7 +4294,6 @@ def printUsage(commands):
> "sync" : P4Sync,
> "rebase" : P4Rebase,
> "clone" : P4Clone,
> - "rollback" : P4RollBack,
> "branches" : P4Branches,
> "unshelve" : P4Unshelve,
> }
next prev parent reply other threads:[~2021-12-20 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-17 14:05 [PATCH v2 0/2] git-p4: remove "debug" and "rollback" verbs Joel Holdsworth
2021-12-17 14:05 ` [PATCH v2 1/2] git-p4: remove "delete" verb Joel Holdsworth
2021-12-20 19:38 ` Junio C Hamano
2021-12-21 10:32 ` Luke Diamand
2021-12-17 14:05 ` [PATCH v2 2/2] git-p4: remove "rollback" verb Joel Holdsworth
2021-12-20 19:32 ` Junio C Hamano [this message]
2021-12-20 21:19 ` [PATCH v2 0/2] git-p4: remove "debug" and "rollback" verbs Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqlf0fvzrf.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=andrew@adoakley.name \
--cc=dendy.ua@gmail.com \
--cc=dorgonman@hotmail.com \
--cc=git@vger.kernel.org \
--cc=jholdsworth@nvidia.com \
--cc=joachim.kuebart@gmail.com \
--cc=johannes.schindelin@gmx.de \
--cc=luke@diamand.org \
--cc=seraphire@gmail.com \
--cc=tzadik.vanderhoof@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).