All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matheus Tavares <matheus.bernardino@usp.br>
Cc: git@vger.kernel.org, Steffen Prohaska <prohaska@zib.de>
Subject: Re: [PATCH] convert: fail gracefully upon missing clean cmd on required filter
Date: Thu, 25 Feb 2021 15:05:50 -0800	[thread overview]
Message-ID: <xmqqsg5jsq7l.fsf@gitster.g> (raw)
In-Reply-To: <b33d0dc82f5ff1fac6772e533bbf21eecfae44ed.1614277014.git.matheus.bernardino@usp.br> (Matheus Tavares's message of "Thu, 25 Feb 2021 15:16:56 -0300")

Matheus Tavares <matheus.bernardino@usp.br> writes:

> The gitattributes documentation mentions that either the clean cmd or
> the smudge cmd can be left unspecified in a filter definition. However,
> when the filter is marked as 'required', the absence of any one of these
> two should be treated as an error. Git already fails under these
> circumstances, but not always in a pleasant way: omitting a clean cmd in
> a required filter triggers an assertion error which leaves the user with
> a quite verbose message:
>
> git: convert.c:1462: convert_to_git_filter_fd: Assertion "ca.drv->clean || ca.drv->process" failed.
>
> This assertion and the one above it are not really necessary, as the
> apply_filter() call bellow them already performs the same checks. And
> when these conditions are not met, the function returns 0, making the
> caller die() with a much nicer message. (Also note that die()-ing here
> is the right behavior as `would_convert_to_git_filter_fd() == true` is a
> precondition to use convert_to_git_filter_fd(), and the former is only
> true when the filter is required.) So remove both assertions and add two
> regression tests to make sure that git fails nicely when either the
> smudge or clean command is missing on a required filter.

Makes sense.

Will queue, thanks.

  reply	other threads:[~2021-02-25 23:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 18:16 [PATCH] convert: fail gracefully upon missing clean cmd on required filter Matheus Tavares
2021-02-25 23:05 ` Junio C Hamano [this message]
2021-02-26  6:27 ` Martin Ågren
2021-02-26 16:23 ` [PATCH v2] " Matheus Tavares
2021-02-28 20:01   ` Martin Ågren

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=xmqqsg5jsq7l.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    --cc=prohaska@zib.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.