git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list

From
Andreas Ericsson <ae@op5.se>
Date
Jan 31, 2008, 09:17 UTC
Message-ID
<47A19211.5090409@op5.se>
In-Reply-To
<47A125D9.2070105@nrlssc.navy.mil>
Brandon Casey wrote:
Show 26 quoted lines
> Johannes Schindelin wrote:
>> Hi,
>>
>> On Wed, 30 Jan 2008, Brandon Casey wrote:
>>
>>> This command requires a revision to be specified on the command line, so 
>>> remove '--default HEAD' from the arguments to git rev-list. They are 
>>> unnecessary.
>> But I thought that you wanted "git filter-branch --msg-filter=rot13" to 
>> work on HEAD by default?
> 
> I do. But isn't that inconsistent with "git filter-branch" does _not_ work
> on HEAD by default and instead prints out usage information?
> 
> If I do:
> 
> 	git filter-branch -d /tmp/git_temp
> 
> and it is successful, I think I would also expect this to succeed:
> 
> 	git filter-branch
> 
> So, I think the "operates on HEAD" by default is consistent with what other
> git tools do, but I think it is not consistent for filter-branch to sometimes
> operate on HEAD by default and sometimes error with usage information.
> 

Well, if there's no filter specified it has nothing to do, so erroring out in the no-arguments-at-all case would be sensible.

OTOH, it would be better to error out for the no-filter case explicitly, which would also cause the no-arguments case to error out.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Brandon CaseyNext: Junio C Hamano
Message 19 of 21 in “filter-branch: assume HEAD if no revision supplied”
  1. filter-branch: assume HEAD if no revision suppliedBrandon Casey, Jan 30, 2008
  2. Johannes SchindelinJan 30, 2008
  3. Junio C HamanoJan 30, 2008
  4. Brandon CaseyJan 30, 2008
  5. 1/2 filter-branch: only print usage information when no arguments suppliedBrandon Casey, Jan 31, 2008
  6. Junio C HamanoJan 31, 2008
  7. Brandon CaseyJan 31, 2008
  8. Junio C HamanoJan 31, 2008
  9. Johannes SchindelinJan 31, 2008
  10. Brandon CaseyJan 31, 2008
  11. filter-branch docs: remove brackets so not to imply revision arg is optionalBrandon Casey, Jan 31, 2008
  12. Junio C HamanoJan 31, 2008
  13. Johannes SchindelinJan 31, 2008
  14. Brandon CaseyJan 31, 2008
  15. Junio C HamanoJan 31, 2008
  16. 2/2 git-filter-branch.sh: don't use --default when calling rev-listBrandon Casey, Jan 31, 2008
  17. Johannes SchindelinJan 31, 2008
  18. Brandon CaseyJan 31, 2008
  19. Andreas EricssonJan 31, 2008
  20. Junio C HamanoJan 31, 2008
  21. Johannes SchindelinJan 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.