git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Samuel Yvon <samuelyvon9@gmail.com>
To: gitster@pobox.com
Cc: Johannes.Schindelin@gmx.de, avarab@gmail.com,
	git@vger.kernel.org, gitgitgadget@gmail.com, me@ttaylorr.com,
	samuelyvon9@gmail.com
Subject: Re: [PATCH v2] builtin-commit: re-read file index before run_status
Date: Wed, 17 Nov 2021 11:48:42 -0500	[thread overview]
Message-ID: <20211117164842.36381-1-samuelyvon9@gmail.com> (raw)
In-Reply-To: <xmqqpmr5nekx.fsf@gitster.g>

Apologies for the time I took to reply,

Junio C Hamano <gitster@pobox.com> writes:
> And moving the call would affect both the contents of the status
> buffer (i.e. the list of paths got changed starts including what
>         pre-commit did) and the "committable" bit by counting such a change
> as a true change, avoiding the "no empty commit by default" check,
> in a consistent way, hopefully.  I wonder if we have test to
> demonstrate that, and if there isn't perhaps we would want to add
> one.

So, just to make sure I understand well, the concern is that an empty commit
would trigger the commit routine, run the pre-commit hook, which may add files
(thus making it an non-empty commit) and then push 100% automatic changes to a
repo. I agree that this would be invalid behaviour and very odd, I will 
make sure no empty commit is allowed.

Junio C Hamano <gitster@pobox.com> writes:
> Samuel Yvon <samuelyvon9@gmail.com> writes:
> > However, calling run_status after the cache reset does not update
> > the status line to state of the current index in the case a
> > pre-commit hook is ran and changes files in the staging area.
> 
> And if this change also affects the "committable" assignment in a
> consistent way, it should probably want to be mentioned in this
> paragraph, too.

What do you mean by "commitable assignment"? 

> I am not convinced by the claim that there is no need for careful
> transition plans (yet), but I personally agree with the end state
> (with the above suggested tweaks, that is).

With the last message, I agree the safest option is probably to leave this
configurable for now and off by default.

So here's the next steps that I intend to take to get this merged in:

- Add a test for empty commit (if non-existent) and ensure the behaviour is the same
- Add a config option (or maybe a switch?) for migration purposes, with the default
  being the current behaviour.



  reply	other threads:[~2021-11-17 16:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09  2:06 [PATCH] builtin-commit: re-read file index before launching editor Samuel Yvon via GitGitGadget
2021-11-09  2:32 ` Ævar Arnfjörð Bjarmason
2021-11-09  3:08   ` samuelyvon9
2021-11-09  9:11     ` Ævar Arnfjörð Bjarmason
2021-11-09 15:22       ` Samuel Yvon
2021-11-09 18:36         ` Junio C Hamano
2021-11-09 20:01           ` Samuel Yvon
2021-11-11 22:09             ` Junio C Hamano
2021-11-09 16:41 ` Description of github.com/git/git, was " Johannes Schindelin
2021-11-09 17:01   ` Samuel Yvon
2021-11-09 19:03   ` Junio C Hamano
2021-11-09 19:23     ` Taylor Blau
2021-11-09 19:27     ` Samuel Yvon
2021-11-10 12:22       ` Johannes Schindelin
2021-11-11 17:55 ` [PATCH v2] builtin-commit: re-read file index before run_status Samuel Yvon via GitGitGadget
2021-11-12 23:23   ` Junio C Hamano
2021-11-17 16:48     ` Samuel Yvon [this message]
2021-11-18 23:51       ` 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=20211117164842.36381-1-samuelyvon9@gmail.com \
    --to=samuelyvon9@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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).