From nobody Sat Aug 28 22:02:33 2021 X-Original-To: freebsd-git@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DC6D3178B599 for ; Sat, 28 Aug 2021 22:02:40 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GxrDJ3yHLz3lfD; Sat, 28 Aug 2021 22:02:40 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: by mail-oo1-xc30.google.com with SMTP id b5-20020a4ac285000000b0029038344c3dso3235791ooq.8; Sat, 28 Aug 2021 15:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nv7GtXdu/j6PywLzojtw0NL18CSp6swB95wQKXbThBE=; b=Pre+9D/cNvPJ9XxXbk/gHDTr0uhe+VVMtiEPHYqwaDoTuCeDOER2FFthG05ZrO5Ew/ MkKEYBGDhWe3Kh8NM3A5gREYpvHKtQWr8yOuhJoDIV/6o/691QvCvJrlPZi0xgL9UI2U gM5fQQC7RVHiWa+3GberVNbw3VX7g+bcRBTEURD1suAmoxmYr5AKOEB2iPHdKnFhtnIt h6wenOkwAyHHUD/9WZW2A1hzaIZdICgZxpnwxoSAOfRzW03ZZZezGhQ5LiXm0VGT0gzf Ge7uAE/oTfUHNwa7+51EKgEeFrdbiZUO1JOWj7mLHOXVKKLtDa/aqRyv4TJuM0bZTai2 OciA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nv7GtXdu/j6PywLzojtw0NL18CSp6swB95wQKXbThBE=; b=JCvmB6i6yEfLrTd4XUgh7ci8o24LPYDKg8Dz7jCxiKQ5gvqas+wIkqCZnhKk57v4J/ Ch5E1OOpFASlEnTPwMtDjLvmAcGxTq0CVeo2Sl4NwxQBVgGa8AGP8KjqnesXmRUAmJES nCeXYApHWwwx3EIOa9MN3Dr0sbut0Fxu04A4K4P4ioSRB45+psOWyQEHcpbOolwLhV8b 49kpHginKyp6fhBekrndFV8znmMgzJeiQCFORyuPizZk+/QldiTeHMhdb1twJR7Y7O8Z YjfRbVOtukQ+OUthArogkJBRi4YnD56IC7xhmGPY9ky8L0gjXXkKpeFrVr21HEKbZn39 CWnA== X-Gm-Message-State: AOAM532n6CnTJPoaEmtecBsrk7ORC0ApPy145cBjC38sZRVh766YYEcH cHvOWdEHvTPBnTwLx7SiPvE8r6KbHOz+sd67pPBZ84faAvU= X-Google-Smtp-Source: ABdhPJz6x/KwuahDfVX3Gd/E4A3iBFb3puoF4JDjXTvM4u2FY8yp+wpKZ+ErK35VmiZatciTdVXcXZD3kH9J9dil9zI= X-Received: by 2002:a4a:b34c:: with SMTP id n12mr4681359ooo.19.1630188153608; Sat, 28 Aug 2021 15:02:33 -0700 (PDT) List-Id: Discussion of git use in the FreeBSD project List-Archive: https://lists.freebsd.org/archives/freebsd-git List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-git@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:704d:0:0:0:0:0 with HTTP; Sat, 28 Aug 2021 15:02:33 -0700 (PDT) In-Reply-To: <20210828214853.vbo7kh5fo5n5nrdn@t480.local> References: <20210828204434.n45rsndnehy2tsnb@t480.local> <20210828214853.vbo7kh5fo5n5nrdn@t480.local> From: Rob Wing Date: Sat, 28 Aug 2021 14:02:33 -0800 Message-ID: Subject: Re: Phabricator workflow with Git To: "Danilo G. Baio" Cc: Warner Losh , freebsd-git Content-Type: multipart/alternative; boundary="000000000000d01e4d05caa5c181" X-Rspamd-Queue-Id: 4GxrDJ3yHLz3lfD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: Y --000000000000d01e4d05caa5c181 Content-Type: text/plain; charset="UTF-8" I think you can: cd tools/tools/git make install Then open up the man page: man git-arc On Saturday, August 28, 2021, Danilo G. Baio wrote: > On Sat, Aug 28, 2021 at 03:02:00PM -0600, Warner Losh wrote: > > Wow! That's convoluted. > > /me hides > > > > > On Sat, Aug 28, 2021 at 2:44 PM Danilo G. Baio > wrote: > > > > > Hi. > > > > > > I'm currently using this workflow: > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - > > > > > > // Create a new branch > > > $ git checkout -b FEATURE > > > > > > // Change stuff and git commit > > > // Note that you already can include the Review information in > > > // Phabricator format. > > > > > > ``` > > > <> > > > > > > Summary: > > > > > > Test Plan: > > > > > > Reviewers: > > > > > > Subscribers: > > > ``` > > > > > > // Open a review with the first commit > > > $ arc diff --create HEAD~ > > > > > > > > > // If it's accepted, fix the commit log message, rebase with main > > > // branch, and push > > > > > > > All that's replaced by 'git arc create HEAD' > > > > > > > $ git commit --amend > > > $ git rebase -i main > > > $ git push remote_name FEATURE:main > > > > > > > git arc stage. This also takes care of adding differential revision, etc. > > > > will stage it into main, then you can just 'git push freebsd' to put it > in > > the the tree. > > > > > > > // If it's NOT accepted > > > // Change stuff and add a second git commit > > > > > > // Update review with the two commits > > > $ arc diff --update DXXXXX HEAD~2 > > > > > > > git arc update > > > > does this automatically. > > > > > > > // If it's accepted, you can soft reset both commits and do a new one > > > // or, just use `git merge and squash`. > > > > > > // merge/squash way > > > // Set the second commit to be squashed > > > > > > $ git rebase -i main > > > > > > ``` > > > pick 954c5d4626 Readme: First commit > > > squash 7231873f23 Makefile: Second commit > > > ``` > > > > > > or > > > > > > $ git reset --soft HEAD~2 > > > // And add a final commit > > > > > > > I'd document only rebase. The git reset workflow is somewhat more > dangerous > > and error-prone. > > > > // Submit > > > $ git push remote_name FEATURE:main > > > > > > > git arc stage > > git push > > > > is what I use, but I know lots of people like the branch:main notation. > > It's harder to use, though when you lose the race. If you stage on main, > > then git pull --rebase will do the right thing in one step rather than > > several. > > > > > > > // Delete FEATURE branch > > > > > > $ git checkout main > > > $ git pull origin main --no-ff > > > > > > > --ff-only don't you mean? You *NEVER* want a non-ff pull with upstream. > > Ever. It leads to great evil and lost changes. > > > > > Yes, sorry. > > > > > > $ git branch -d FEATURE > > > > > > > Yea, this is what I use, but I have a script that does this over all the > > branches.... > > > > > > > I know there are git-arc (tools/tools/git-arc) on base, but I still > > > didn't use it. > > > > > > > We should only document it, since it hides all this ugliness and makes > > things easier, less tedious and less error-prone. > > > > > > > I just want to check if there are other ways to do that (that you > > > recommend), or if can I document it, at least for now, on our > > > Phabricator Wiki page [1]. > > > > > > > > > 1 - https://wiki.freebsd.org/Phabricator > > > > > > While you can document what you've said, I found it somewhat confusing to > > follow, especially relative > > to git arc. > > > > Warner > > > > Glad that I sent this message here. > > So, I'll test/use `git arc`. > > Is there anything written about it elsewhere? > > Thank you for the prompt reply and the tips. > > Regards. > -- > Danilo G. Baio (dbaio) > --000000000000d01e4d05caa5c181--