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

Re: [PATCH] format-patch: dereference tags with --ignore-if-in-upstream

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 1, 2015, 11:22 UTC
Message-ID
<20150601112212.GA140991@vauxhall.crustytoothpaste.net>
In-Reply-To
<20150601102046.GA31792@peff.net>
On Mon, Jun 01, 2015 at 06:20:46AM -0400, Jeff King wrote:
> So I think what you really want is lookup_commit_reference. And the
> error message is really not "invalid tag", but "not a commit". I think
> you can just use lookup_commit_or_die.
Thanks.  That does seem to be what I want.
Show 6 quoted lines
> As an aside, now that we are dereferencing, these flags are from the
> wrong object. They _should_ be the same (we mark the tag as
> UNINTERESTING, too), but it's a little weird that at the end of the
> function we restore the saved flags from the tag object onto the commit.
> Just bumping the assignment of flags{1,2} would work (or just bump up
> the lookup_commit_or_die call to where we assign to o{1,2}).

I tried looking up the flags after dereferencing the tags, but that led to the die("Not a range.") being triggered. That's why the commit message ended up mentioning loading the flags before dereferencing.

Show 7 quoted lines
> I think this avoids the usual "wc" whitespace pitfall because you don't
> use double-quotes. But maybe:
> 
>   grep "^From " patch1 >count &&
>   test_line_count = 2 patch1
> 
> would be more idiomatic.

I can certainly make that change. I made the test as similar as possible to other tests in the area, but I wasn't aware of test_line_count.

I'll reroll the patch later today.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Jeff KingNext: Jeff King
Message 10 of 21 in “seg fault in "git format-patch"”
  1. Bruce KorbMay 31, 2015
  2. Christian CouderMay 31, 2015
  3. Bruce KorbMay 31, 2015
  4. Bruce KorbMay 31, 2015
  5. Christian CouderMay 31, 2015
  6. Christian CouderMay 31, 2015
  7. Christian CouderJun 1, 2015
  8. format-patch: dereference tags with --ignore-if-in-upstreambrian m. carlson, Jun 1, 2015
  9. Jeff KingJun 1, 2015
  10. brian m. carlsonJun 1, 2015
  11. Jeff KingJun 1, 2015
  12. Junio C HamanoJun 1, 2015
  13. Junio C HamanoJun 1, 2015
  14. Jeff KingJun 1, 2015
  15. Junio C HamanoJun 1, 2015
  16. brian m. carlsonJun 1, 2015
  17. Junio C HamanoJun 1, 2015
  18. Junio C HamanoJun 1, 2015
  19. Christian CouderJun 1, 2015
  20. Christian CouderJun 1, 2015
  21. Bruce KorbJun 1, 2015

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.