git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Elijah Newren <newren@gmail.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 1/2] sequencer: clear state upon dropping a become-empty commit
Date: Wed, 11 Mar 2020 15:33:17 -0400	[thread overview]
Message-ID: <20200311193317.GC27978@coredump.intra.peff.net> (raw)
In-Reply-To: <CABPp-BFtspDhSherYyhH-Aw=oPLzCiGfbMUiLPB0n1rnzV3k0Q@mail.gmail.com>

On Wed, Mar 11, 2020 at 10:16:22AM -0700, Elijah Newren wrote:

> > It feels like the set of paths to be cleaned up would probably exist
> > elsewhere in a helper function for cleaning up real cherry-picks. But
> > I'll defer to your expertise there, as I don't know the sequencer code
> > very well.
> 
> Yeah, I was looking for something like that but instead found the
> unlink() directives for cleaning up various state files scattered
> throughout the code.  I think sequencer.c is in need of some cleaning
> up; the slow transition from "do what shell does, now work both with
> an external shell and some pieces built in, now move slightly more
> towards being built-in" seems to have left a lot of artifacts around
> and made it a bit unwieldy.

OK. As long as you looked and didn't find anything obvious that should
be used, I'm content to leave it for a later cleanup (I also looked
briefly and didn't find anything useful).

> I'm not sure deferring to my expertise with sequencer.c makes sense,
> since you have about twice as many commits to sequencer.c as me.  But
> I was deferring to Phillip and he commented on my v1 and seemed happy
> (other than my missing handling of MERGE_MSG).

Heh, all memories of sequencer.c have been wiped from my memory. I
thought you might have looked at it more recently because of this rebase
backend work, but I guess that didn't involve poking at the sequencer
internals much.

> > This could check the output of git-status to avoid poking around in the
> > .git directory itself. But I doubt that the exact filenames are going to
> > change, and parsing the output of status is its own problem (I don't
> > think we give this "state" info in a machine-readable way).
> 
> Yeah, it's not clear to me what's best either.  When I was testing my
> changes locally I was checking status output.  However, after creating
> the fix and deciding to add a regression test, I switched to checking
> for the existence of those files basically for the reasons you
> mention, despite knowing I'm only testing for certain state files
> rather than testing that git in general doesn't think it's still in
> the middle of some operation.

I did just double check that "git status" has no way to produce a
machine-readable version of the data. That might be worth addressing in
general[1], but I think what you have here is a good test for now.

-Peff

[1] In particular, I think that git-prompt.sh reimplements some of this
    logic, and I would be surprised if there wasn't some weird corner
    case where they differ. The prompt code does try to avoid invoking
    subprocesses for efficiency, but I imagine we're running git-status
    already to get the dirty state.

  reply	other threads:[~2020-03-11 19:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  5:13 [PATCH 0/2] Fix 2.26.0 rebase regression and documentation shortcoming Elijah Newren via GitGitGadget
2020-03-11  5:13 ` [PATCH 1/2] sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commit Elijah Newren via GitGitGadget
2020-03-11 10:30   ` Phillip Wood
2020-03-11 18:38     ` Junio C Hamano
2020-03-11 19:27       ` Jeff King
2020-03-11 20:18         ` Junio C Hamano
2020-03-11  5:13 ` [PATCH 2/2] git-rebase.txt: highlight backend differences with commit rewording Elijah Newren via GitGitGadget
2020-03-11 15:30 ` [PATCH v2 0/2] Fix 2.26.0 rebase regression and documentation shortcoming Elijah Newren via GitGitGadget
2020-03-11 15:30   ` [PATCH v2 1/2] sequencer: clear state upon dropping a become-empty commit Elijah Newren via GitGitGadget
2020-03-11 16:34     ` Jeff King
2020-03-11 17:16       ` Elijah Newren
2020-03-11 19:33         ` Jeff King [this message]
2020-03-11 15:30   ` [PATCH v2 2/2] git-rebase.txt: highlight backend differences with commit rewording Elijah Newren via GitGitGadget
2020-03-11 16:36     ` Jeff King
2020-03-11 19:10       ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311193317.GC27978@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).