From: Orgad Shaneh <firstname.lastname@example.org> To: "Ævar Arnfjörð Bjarmason" <email@example.com> Cc: Eric Sunshine <firstname.lastname@example.org>, Orgad Shaneh via GitGitGadget <email@example.com>, Git List <firstname.lastname@example.org> Subject: Re: [PATCH v4 1/2] hooks: allow input from stdin for commit-related hooks Date: Fri, 20 Nov 2020 14:34:19 +0200 [thread overview] Message-ID: <CAGHpTB+LzXTNp3UGia6bdEDqV=mjAY+JQkO3aeUmddhYa1xajw@mail.gmail.com> (raw) In-Reply-To: <email@example.com> On Fri, Nov 20, 2020 at 12:59 PM Ævar Arnfjörð Bjarmason <firstname.lastname@example.org> wrote: > > > On Fri, Nov 20 2020, Orgad Shaneh wrote: > > > Can you suggest an alternative way to determine if I can accept user > > input from the console or not? > > Like Eric noted in his reply I can't think of a way to do that > particular thing reliably either, and agree with his comments that if > such a way is found / some aspect of this change is kept having this > explanation in the patch/commit message is really helpful. I'll reword. > I think what you're trying to do here isn't a good fit for most git > workflows. Instead of trying to interactively compose a commit message > why not change the commit template to start with e.g.: > > # You must replace XXX with an issue number here!: > Issue #XXX: > > That gives the user the same thing to fill out, but in their editor > instead of via some terminal/GUI prompt. They need to write the rest of > the commit message anyway in the editor, so even if you could why open > up two UIs? We do have a template. The hook pops a listbox with all the open issues assigned to the user, which he/she can easily pick from, instead of searching for them in the browser and copying the issue id. This is only done if the user doesn't write an issue in the commit message. > Projects that have these conventions also typically settle on just not > trying to solve this problem on the client-side, but e.g. having a > pre-receive hook that does the validation, or do it via CI / before a > merge to master happens etc. We have validation on the server too. The hook is there for convenience. - Orgad
next prev parent reply other threads:[~2020-11-20 12:38 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-17 15:02 [PATCH] hooks: allow input from stdin Orgad Shaneh via GitGitGadget 2020-11-17 19:59 ` Junio C Hamano 2020-11-19 15:50 ` [PATCH v2] " Orgad Shaneh via GitGitGadget 2020-11-19 15:56 ` [PATCH v3] hooks: allow input from stdin for commit-related hooks Orgad Shaneh via GitGitGadget 2020-11-19 19:16 ` Junio C Hamano 2020-11-19 20:41 ` Orgad Shaneh 2020-11-19 20:56 ` [PATCH v4 0/2] " Orgad Shaneh via GitGitGadget 2020-11-19 20:56 ` [PATCH v4 1/2] " Orgad Shaneh via GitGitGadget 2020-11-19 21:23 ` Eric Sunshine 2020-11-19 21:32 ` Junio C Hamano 2020-11-20 5:23 ` Orgad Shaneh 2020-11-20 6:38 ` Eric Sunshine 2020-11-20 6:48 ` Eric Sunshine 2020-11-20 7:16 ` Orgad Shaneh 2020-11-20 18:13 ` Junio C Hamano 2020-11-20 10:59 ` Ævar Arnfjörð Bjarmason 2020-11-20 12:34 ` Orgad Shaneh [this message] 2020-11-19 20:56 ` [PATCH v4 2/2] commit: fix stdin conflict between message and hook Orgad Shaneh via GitGitGadget 2020-12-09 20:06 ` [PATCH v5 0/2] hooks: allow input from stdin for commit-related hooks Orgad Shaneh via GitGitGadget 2020-12-09 20:06 ` [PATCH v5 1/2] hooks: lay foundations for passing stdin to hooks Orgad Shaneh via GitGitGadget 2020-12-09 20:06 ` [PATCH v5 2/2] hooks: allow input from stdin for commit-related hooks Orgad Shaneh via GitGitGadget 2020-12-09 22:37 ` 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='CAGHpTB+LzXTNp3UGia6bdEDqV=mjAY+JQkO3aeUmddhYa1xajw@mail.gmail.com' \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH v4 1/2] hooks: allow input from stdin for commit-related hooks' \ /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
Code repositories for project(s) associated with this 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).