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

Re: [RFC] checkout to notice forks (Re: Minor annoyance with git push)

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2008, 04:11 UTC
Message-ID
<7v4pc843yg.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0802162202310.5496@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> I like this idea a lot. I'd actually also like it for commit, although (1) 
> and (3a) obviously don't happen there. It would help to combat my tendency 
> to forget to push when I mean to.
Thanks.
Show 14 quoted lines
>> +/*
>> + * We really should allow cb_data... Yuck
>> + */
>> +static const char *branch_name;
>> +static int branch_name_len;
>> +static char *found_remote;
>> +static char *found_merge;
>> +static int read_branch_config(const char *var, const char *value)
>> +{
>
> ...
>
> I think you want branch_get(), which handles all the config file stuff up 
> to approximately here:

Fixups are very much welcomed. This was more or less a proof of concept.

Show 18 quoted lines
>> +	if (show_log) {
>> +		const char *args[32];
>> +		int ac;
>> +
>> +		ac = 0;
>> +		args[ac++] = "log";
>> +		args[ac++] = "--pretty=oneline";
>> +		args[ac++] = "--abbrev-commit";
>> +		args[ac++] = "--left-right";
>> +		args[ac++] = "--boundary";
>> +		args[ac++] = symmetric;
>> +		args[ac++] = "--";
>> +		args[ac] = NULL;
>> +
>> +		run_command_v_opt(args, RUN_GIT_CMD);
>
> We really should be able to do this in-process, although I'm not sure if 
> we really can.

The code runs in_merge_bases() twice, between our branch head and the base, but if we really care about the performance, we can have a single merge-base traversal and the resulting object pool will have everything necessary to emit the log output without a separate traversal.

Because I think that is reasonably easy, I just did not bother to. This is not a performance critical piece of code anyway.

One thing I thought about was to limit the output to latest N entries from both sides. That would also be easier to implement if we do a single merge-base traversal and reuse the result.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 30 of 71 in “Minor annoyance with git push”
  1. Martin LanghoffFeb 8, 2008
  2. Martin LanghoffFeb 8, 2008
  3. Junio C HamanoFeb 8, 2008
  4. Steffen ProhaskaFeb 9, 2008
  5. Junio C HamanoFeb 10, 2008
  6. Johannes SchindelinFeb 10, 2008
  7. Johannes SchindelinFeb 8, 2008
  8. Martin LanghoffFeb 8, 2008
  9. Mike HommeyFeb 8, 2008
  10. SeanFeb 8, 2008
  11. Steffen ProhaskaFeb 8, 2008
  12. Johannes SchindelinFeb 8, 2008
  13. Martin LanghoffFeb 8, 2008
  14. Johannes SchindelinFeb 8, 2008
  15. Jeff KingFeb 9, 2008
  16. Jeff KingFeb 9, 2008
  17. Johannes SchindelinFeb 9, 2008
  18. Jeff KingFeb 9, 2008
  19. Steffen ProhaskaFeb 9, 2008
  20. Jeff KingFeb 9, 2008
  21. Junio C HamanoFeb 9, 2008
  22. Jeff KingFeb 9, 2008
  23. Martin LanghoffFeb 9, 2008
  24. Johannes SchindelinFeb 9, 2008
  25. Junio C HamanoFeb 10, 2008
  26. Jeff KingFeb 10, 2008
  27. Johannes SchindelinFeb 10, 2008
  28. [RFC] checkout to notice forks (Re: Minor annoyance with git push)Junio C Hamano, Feb 17, 2008
  29. Daniel BarkalowFeb 17, 2008
  30. Junio C HamanoFeb 17, 2008
  31. Daniel BarkalowFeb 17, 2008
  32. Junio C HamanoFeb 17, 2008
  33. Daniel BarkalowFeb 17, 2008
  34. Jeff KingFeb 17, 2008
  35. Santi BéjarFeb 20, 2008
  36. Martin LanghoffFeb 19, 2008
  37. checkout: tone down the "forked status" diagnostic messagesJunio C Hamano, Feb 20, 2008
  38. Jeff KingFeb 21, 2008
  39. checkout: updates to tracking reportJunio C Hamano, Feb 21, 2008
  40. Jay SoffianFeb 21, 2008
  41. Daniel BarkalowFeb 21, 2008
  42. Jay SoffianFeb 21, 2008
  43. Steffen ProhaskaFeb 9, 2008
  44. Johannes SchindelinFeb 9, 2008
  45. Junio C HamanoFeb 10, 2008
  46. Johannes SchindelinFeb 10, 2008
  47. Jeff KingFeb 10, 2008
  48. Johannes SchindelinFeb 10, 2008
  49. Jeff KingFeb 10, 2008
  50. Johannes SchindelinFeb 10, 2008
  51. Jeff KingFeb 10, 2008
  52. Junio C HamanoFeb 20, 2008
  53. Johannes SchindelinFeb 20, 2008
  54. Jay SoffianFeb 20, 2008
  55. Johannes SchindelinFeb 20, 2008
  56. Steven WalterFeb 21, 2008
  57. Johannes SchindelinFeb 22, 2008
  58. Jeff KingFeb 20, 2008
  59. Junio C HamanoFeb 20, 2008
  60. Jeff KingFeb 20, 2008
  61. Jeff KingFeb 20, 2008
  62. Junio C HamanoFeb 20, 2008
  63. Jeff KingFeb 20, 2008
  64. Wincent ColaiutaFeb 10, 2008
  65. Steven WalterFeb 10, 2008
  66. Johannes SchindelinFeb 10, 2008
  67. Johannes SchindelinFeb 10, 2008
  68. Wincent ColaiutaFeb 10, 2008
  69. Jeff KingFeb 10, 2008
  70. Junio C HamanoFeb 10, 2008
  71. Jeff KingFeb 10, 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.