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

Re: [PATCH] filter-branch: consider refs can refer to an object other than commit or tag

From
Yuki Kokubun <orga.chem.job@gmail.com>
Date
Mar 22, 2018, 14:26 UTC
Message-ID
<5ab3bd79.d14d650a.be5c0.8544@mx.google.com>
In-Reply-To
<xmqqpo3xnqq4.fsf@gitster-ct.c.googlers.com>
Show 24 quoted lines
> Yuki Kokubun <orga.chem.job@gmail.com> writes:
> 
> >> Yuki Kokubun <orga.chem.job@gmail.com> writes:
> >> 
> >> > "git filter-branch -- --all" can be confused when refs that refer to objects
> >> > other than commits or tags exists.
> >> > Because "git rev-parse --all" that is internally used can return refs that
> >> > refer to an object other than commit or tag. But it is not considered in the
> >> > phase of updating refs.
> >> 
> >> Could you describe what the consequence of that is?  We have a ref
> >> that points directly at a blob object, or a ref that points at a tag
> >> object that points at a blob object.  The current code leaves both of
> >> these refs in "$tempdir/heads".  Then...?
> >
> > Sorry, this is my wrong.
> > I wrongly thought only refs/replace can point at a blob or tree object.
> 
> No need to be sorry.  You still need to describe what (bad things)
> happen if we do not filter out refs that do not point at committish
> in the proposed log message.  
> 
> IOW, can you elaborate and clarify your "can be confused" at the
> beginning?

I meant the confusion is abnormal messages from the output of "git filter-branch -- --all". For example, this is an output of "git filter-branch -- --all":

Rewrite bcdbd016c77df3d5641a3cf820b2ed46ba7bf3b4 (5/5) (0 seconds passed, remaining 0 predicted)
WARNING: Ref 'refs/heads/master' is unchanged
WARNING: Ref 'refs/heads/no-newline' is unchanged
WARNING: Ref 'refs/heads/original' is unchanged
error: object 1bf53b49c26465454e4ac377f2ed3f91bb1d6ac1 is a tree, not a commit
error: object 1bf53b49c26465454e4ac377f2ed3f91bb1d6ac1 is a tree, not a commit
fatal: ambiguous argument 'refs/replace/8a2016f3730cad8309c110f819c855403ed0a5b9^0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
WARNING: Ref 'refs/replace/8a2016f3730cad8309c110f819c855403ed0a5b9' is unchanged
WARNING: Ref 'refs/tags/add-file' is unchanged
WARNING: Ref 'refs/tags/file' is unchanged
error: object 1bf53b49c26465454e4ac377f2ed3f91bb1d6ac1 is a tree, not a commit
error: object 1bf53b49c26465454e4ac377f2ed3f91bb1d6ac1 is a tree, not a commit
fatal: ambiguous argument 'refs/tags/treetag^0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
WARNING: Ref 'refs/tags/treetag' is unchanged

You can see a lot of terrible messages such as "error" and "fatal". But on the whole, the result of "git filter-branch -- --all" is not so abnormal. So, this is a just problem about abonormal messages.

I think this messages should be suppressed. How do you feel about it?

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 20 in “filter-branch: consider refs/replace can refer to an object other than commit”
  1. filter-branch: consider refs/replace can refer to an object other than commitYuki Kokubun, Mar 21, 2018
  2. filter-branch: consider refs can refer to an object other than commit or tagYuki Kokubun, Mar 21, 2018
  3. Junio C HamanoMar 21, 2018
  4. Yuki KokubunMar 21, 2018
  5. Junio C HamanoMar 21, 2018
  6. Yuki KokubunMar 22, 2018
  7. Junio C HamanoMar 22, 2018
  8. Yuki KokubunMar 23, 2018
  9. filter-branch: fix errors caused by refs that cannot be used with ^0Yuki Kokubun, Mar 23, 2018
  10. Junio C HamanoMar 23, 2018
  11. Yuki KokubunMar 24, 2018
  12. filter-branch: fix errors caused by refs that point at non-committishYuki Kokubun, Mar 24, 2018
  13. Junio C HamanoMar 25, 2018
  14. Yuki KokubunMar 25, 2018
  15. Junio C HamanoMar 25, 2018
  16. filter-branch: fix errors caused by refs that point at non-committishYuki Kokubun, Mar 25, 2018
  17. Yuki KokubunMar 25, 2018
  18. Junio C HamanoApr 8, 2018
  19. filter-branch: fix errors caused by refs that point at non-committishYuki Kokubun, Mar 25, 2018
  20. Junio C HamanoMar 25, 2018

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.