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

Re: [PATCH v2 0/8] object_id part 4

From
Jeff King <peff@peff.net>
Date
Jun 20, 2016, 10:05 UTC
Message-ID
<20160620100522.GB14058@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.2.20.1606200853580.22630@virtualbox>
On Mon, Jun 20, 2016 at 09:01:30AM +0200, Johannes Schindelin wrote:
Show 10 quoted lines
> On Sun, 19 Jun 2016, Jeff King wrote:
> 
> > I think traditionally we've avoided struct assignment because some
> > ancient compilers didn't do it. But it's in C89, and I suspect it's
> > crept into the code base anyway over the years without anyone
> > complaining.
> 
> I fear that's my fault, at least partially, seeing as merge-recursive.c
> even *returns* structs (see 6d297f81; I plan to fix that as part of the
> cleaned-up am-3-merge-recursive-direct patch series).

Heh, that commit is quite old. If nobody has complained about it, then I think there is nothing to be sorry about. If struct assignment (and returns) work everywhere, and they make the code easier to read, we should be using them.

I am on the fence regarding oidcpy/oidclr. I agree they _could_ be struct assignments, but it is also convenient to have concept wrapped up in a function, in case we ever want to do anything more complicated.

-Peff
Previous: Johannes SchindelinNext: Junio C Hamano
Message 17 of 20 in “object_id part 4”
  1. 0/8 object_id part 4brian m. carlson, Jun 18, 2016
  2. 6/8 merge-recursive: convert struct merge_file_info to object_idbrian m. carlson, Jun 18, 2016
  3. 4/8 Rename struct diff_filespec's sha1_valid member.brian m. carlson, Jun 18, 2016
  4. 2/8 Apply object_id Coccinelle transformations.brian m. carlson, Jun 18, 2016
  5. Junio C HamanoJun 21, 2016
  6. 8/8 merge-recursive: convert merge_recursive_generic to object_idbrian m. carlson, Jun 18, 2016
  7. 7/8 merge-recursive: convert leaf functions to use struct object_idbrian m. carlson, Jun 18, 2016
  8. 5/8 merge-recursive: convert struct stage_data to use object_idbrian m. carlson, Jun 18, 2016
  9. 3/8 Convert struct diff_filespec to struct object_idbrian m. carlson, Jun 18, 2016
  10. Junio C HamanoJun 21, 2016
  11. brian m. carlsonJun 24, 2016
  12. 1/8 Add basic Coccinelle transforms.brian m. carlson, Jun 18, 2016
  13. Johannes SixtJun 19, 2016
  14. Jeff KingJun 19, 2016
  15. brian m. carlsonJun 19, 2016
  16. Johannes SchindelinJun 20, 2016
  17. Jeff KingJun 20, 2016
  18. Junio C HamanoJun 20, 2016
  19. Junio C HamanoJun 21, 2016
  20. brian m. carlsonJun 22, 2016

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.