git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-filter-branch.sh: clarify an error message
@ 2015-07-04 23:39 Chris Jones
  2015-07-05 13:07 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Jones @ 2015-07-04 23:39 UTC (permalink / raw)
  To: git; +Cc: gitster, johannes.schindelin, peff

Make git filter-branch output a useful error message when a single
commit is given instead of a range.  Currently, when given a command
like git filter-branch --msg-filter 'echo "TEST"' -- abc123, it will
give the message "Which ref do you want to rewrite?".  Instead, what
is needed is a range of commits to rewrite.  This makes it give an
error message that says "You didn't provide a valid range of
commits".

Signed-off-by: Chris W Jones <chris@christopherjones.us>
---
 git-filter-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 5b3f63d..78e7499 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -237,7 +237,7 @@ git rev-parse --no-flags --revs-only
--symbolic-full-name \
 sed -e '/^^/d' "$tempdir"/raw-heads >"$tempdir"/heads
 
 test -s "$tempdir"/heads ||
-       die "Which ref do you want to rewrite?"
+       die "You didn't provide a valid range of commits."
 
 GIT_INDEX_FILE="$(pwd)/../index"
 export GIT_INDEX_FILE
-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-filter-branch.sh: clarify an error message
  2015-07-04 23:39 [PATCH] git-filter-branch.sh: clarify an error message Chris Jones
@ 2015-07-05 13:07 ` Jeff King
  2015-07-05 14:41   ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2015-07-05 13:07 UTC (permalink / raw)
  To: Chris Jones; +Cc: git, gitster, johannes.schindelin

On Sat, Jul 04, 2015 at 07:39:04PM -0400, Chris Jones wrote:

> Make git filter-branch output a useful error message when a single
> commit is given instead of a range.  Currently, when given a command
> like git filter-branch --msg-filter 'echo "TEST"' -- abc123, it will
> give the message "Which ref do you want to rewrite?".  Instead, what
> is needed is a range of commits to rewrite.  This makes it give an
> error message that says "You didn't provide a valid range of
> commits".

Yeah, I agree the current message is a little confusing, and I think
your message is an improvement. I wonder if we can even go a step
further, like mentioning that at least one of the positive tips in your
range must be a ref.

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-filter-branch.sh: clarify an error message
  2015-07-05 13:07 ` Jeff King
@ 2015-07-05 14:41   ` Johannes Schindelin
  2015-07-11  2:04     ` Chris Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2015-07-05 14:41 UTC (permalink / raw)
  To: Jeff King; +Cc: Chris Jones, git, gitster

Hi,

On 2015-07-05 15:07, Jeff King wrote:
> On Sat, Jul 04, 2015 at 07:39:04PM -0400, Chris Jones wrote:
> 
>> Make git filter-branch output a useful error message when a single
>> commit is given instead of a range.  Currently, when given a command
>> like git filter-branch --msg-filter 'echo "TEST"' -- abc123, it will
>> give the message "Which ref do you want to rewrite?".  Instead, what
>> is needed is a range of commits to rewrite.  This makes it give an
>> error message that says "You didn't provide a valid range of
>> commits".
> 
> Yeah, I agree the current message is a little confusing, and I think
> your message is an improvement. I wonder if we can even go a step
> further, like mentioning that at least one of the positive tips in your
> range must be a ref.

I agree, and would even further suggest to use the "did not" form instead of the abbreviated "didn't" one.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-filter-branch.sh: clarify an error message
  2015-07-05 14:41   ` Johannes Schindelin
@ 2015-07-11  2:04     ` Chris Jones
  2015-07-11  8:16       ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Jones @ 2015-07-11  2:04 UTC (permalink / raw)
  To: Johannes Schindelin, Jeff King; +Cc: git, gitster

How does "You did not provide a valid range of commits.  
At least one tip in your range must be a ref." sound?

-- 
Chris
http://christopherjones.us/

On Sun, Jul 5, 2015, at 10:41 AM, Johannes Schindelin wrote:
> Hi,
> 
> On 2015-07-05 15:07, Jeff King wrote:
> > On Sat, Jul 04, 2015 at 07:39:04PM -0400, Chris Jones wrote:
> > 
> >> Make git filter-branch output a useful error message when a single
> >> commit is given instead of a range.  Currently, when given a command
> >> like git filter-branch --msg-filter 'echo "TEST"' -- abc123, it will
> >> give the message "Which ref do you want to rewrite?".  Instead, what
> >> is needed is a range of commits to rewrite.  This makes it give an
> >> error message that says "You didn't provide a valid range of
> >> commits".
> > 
> > Yeah, I agree the current message is a little confusing, and I think
> > your message is an improvement. I wonder if we can even go a step
> > further, like mentioning that at least one of the positive tips in your
> > range must be a ref.
> 
> I agree, and would even further suggest to use the "did not" form instead
> of the abbreviated "didn't" one.
> 
> Thanks,
> Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-filter-branch.sh: clarify an error message
  2015-07-11  2:04     ` Chris Jones
@ 2015-07-11  8:16       ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2015-07-11  8:16 UTC (permalink / raw)
  To: Chris Jones; +Cc: Jeff King, git, gitster

Hi Chris,

On 2015-07-11 04:04, Chris Jones wrote:
> How does "You did not provide a valid range of commits.  
> At least one tip in your range must be a ref." sound?

Maybe a bit shorter, as well as less accusing (which "You did not...!" may sound):

    filter-branch requires a valid commit range.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-11  8:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-04 23:39 [PATCH] git-filter-branch.sh: clarify an error message Chris Jones
2015-07-05 13:07 ` Jeff King
2015-07-05 14:41   ` Johannes Schindelin
2015-07-11  2:04     ` Chris Jones
2015-07-11  8:16       ` Johannes Schindelin

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).