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 23, 2018, 02:15 UTC
Message-ID
<5ab46520.0352650a.cc02b.a177@mx.google.com>
In-Reply-To
<xmqq370sm4cv.fsf@gitster-ct.c.googlers.com>
Show 20 quoted lines
> However, if we pre-filter to limit the refs in "$tempdir/heads" to
> those that are committish (i.e. those that pass "$ref^0") like the
> patch and subsequent discussion suggests, wouldn't we lose the
> warning for these replace refs and non-committish tags.  We perhaps
> could do something like:
> 
> 	git rev-parse --no-flags ... >"$tempdir/raw-heads" || exit
> 
> 	while read ref
> 	do
> 		case "$ref" in ^?*) continue ;; esac
> 		if git rev-parse --verify "$ref^0" 2>/dev/null
>                 then
> 			echo "$ref"
> 		else
> 			warn "WARNING: not rewriting '$ref' (not a committish)"
> 		fi
> 	done >"$tempdir/heads" <"$tempdir/raw-heads"
> 
> (note: the else clause is new, relative to my earlier suggestion).

I agree these suggestions. I'm gonna send a new patch that follow it.

Previous: Junio C HamanoNext: Yuki Kokubun
Message 8 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.