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

Re: [PATCH v4 00/13] New remote-hg helper

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 1, 2012, 02:46 UTC
Message-ID
<CAMP44s1v5Au7=Pt-_9MV54VGC-SiTte=aL0S9ekZB9yxiU+wKw@mail.gmail.com>
In-Reply-To
<alpine.LNX.2.00.1210311613550.3197@iabervon.org>
On Thu, Nov 1, 2012 at 12:14 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 20 quoted lines
> I think that may be true where you have "next" in both places, but I
> think:
>
> $ git checkout -b new-branch master
> $ git fast-export ^master new-branch
>
> ought to emit no "commit" lines, but needs to emit a "reset" line. After
> all, you haven't told fast-export that the ref "new-branch" is up to date,
> and you have told it that you want it to be exported. If you create a new
> branch off of an existing commit, don't change it, and push it to hg, it
> shouldn't be up to remote-hg to figure out what should happen with no
> input; it should get a:
>
> reset refs/heads/new-branch
> from [something]
>
> I don't know why Johannes seems to want [something] not to be a mark
> reference (unless he's complaining about getting an invalid mark
> reference when there aren't any marks defined), but surely something of
> the above form is necessary to tell remote-hg to create the new branch.

I don't know what Johannes wants, but it has been discussed that not everybody is using marks.

When you use marks, the following patch fixes the issue:
http://article.gmane.org/gmane.comp.version-control.git/208730
Show 8 quoted lines
> I think it would be worth testing that:
>
> $ git checkout -b new-branch master
> $ git push hg new-branch
>
> creates the new branch successfully (which I think it does, but wouldn't
> if "git fast-export ^master new-branch" actually returned nothing;
> parsed_refs gets it from the reset line).
And it does, with the above patch, a similar command is even in the tests.

The reason why 'git fast-export ^master new-branch' returning nothing doesn't affect, is that transport helpers wouldn't use negative refs (e.g. ^master). Transport helper passes whatever the uses specifies. I you say 'new-branch', that's exactly what the transport helper will receive. It works because transport helpers use marks.

Nobody expects '^master new-branch' to do something useful, everybody uses marks.

> AFAICT, your code relies on getting the behavior that fast-export actually
> gives, not the behavior you seem to want or the behavior Johannes seems to
> want. And the reason that you don't need any changes to fast-export is
> that your process maps marks instead of sha1s.
No. In order to make use of this bug, the user would have to do:
% git push hg ^master new-branch

Otherwise nothing would get pushed, with or without my first patch[1]. To make 'git push hg new-branch' work, you need my second patch[2].

Cheers.

[1] http://article.gmane.org/gmane.comp.version-control.git/208729 [2] http://article.gmane.org/gmane.comp.version-control.git/208730

-- 
Felipe Contreras
Previous: Daniel BarkalowNext: Junio C Hamano
Message 54 of 75 in “New remote-hg helper”
  1. 00/13 New remote-hg helperFelipe Contreras, Oct 28, 2012
  2. 01/13 Add new remote-hg transport helperFelipe Contreras, Oct 28, 2012
  3. 02/13 remote-hg: add support for bookmarksFelipe Contreras, Oct 28, 2012
  4. 03/13 remote-hg: add support for pushingFelipe Contreras, Oct 28, 2012
  5. 04/13 remote-hg: add support for remote pushingFelipe Contreras, Oct 28, 2012
  6. 05/13 remote-hg: add support to push URLsFelipe Contreras, Oct 28, 2012
  7. 06/13 remote-hg: make sure the encoding is correctFelipe Contreras, Oct 28, 2012
  8. 07/13 remote-hg: match hg merge behaviorFelipe Contreras, Oct 28, 2012
  9. 08/13 remote-hg: add support for hg-git compat modeFelipe Contreras, Oct 28, 2012
  10. 09/13 remote-hg: add compat for hg-git author fixesFelipe Contreras, Oct 28, 2012
  11. 10/13 remote-hg: fake bookmark when there's noneFelipe Contreras, Oct 28, 2012
  12. 11/13 remote-hg: add support for fake remoteFelipe Contreras, Oct 28, 2012
  13. 12/13 remote-hg: add tests to compare with hg-gitFelipe Contreras, Oct 28, 2012
  14. 13/13 remote-hg: add extra author testFelipe Contreras, Oct 28, 2012
  15. Jeff KingOct 29, 2012
  16. Felipe ContrerasOct 29, 2012
  17. Jeff KingOct 29, 2012
  18. Felipe ContrerasOct 29, 2012
  19. Jeff KingOct 29, 2012
  20. Felipe ContrerasOct 29, 2012
  21. Jeff KingOct 29, 2012
  22. Felipe ContrerasOct 30, 2012
  23. Johannes SchindelinOct 30, 2012
  24. Felipe ContrerasOct 30, 2012
  25. Johannes SchindelinOct 30, 2012
  26. Felipe ContrerasOct 30, 2012
  27. Michael J GruberOct 31, 2012
  28. Jeff KingOct 31, 2012
  29. Felipe ContrerasOct 31, 2012
  30. Johannes SchindelinOct 31, 2012
  31. Felipe ContrerasOct 31, 2012
  32. Jonathan NiederOct 31, 2012
  33. Felipe ContrerasOct 31, 2012
  34. Lack of netiquette, was Re: [PATCH v4 00/13] New remote-hg helperJohannes Schindelin, Oct 31, 2012
  35. Felipe ContrerasOct 31, 2012
  36. Junio C HamanoNov 1, 2012
  37. Felipe ContrerasNov 1, 2012
  38. René ScharfeNov 1, 2012
  39. Tomas CarneckyNov 1, 2012
  40. Martin LanghoffNov 1, 2012
  41. Felipe ContrerasNov 1, 2012
  42. Martin LanghoffNov 1, 2012
  43. Felipe ContrerasNov 1, 2012
  44. Andreas EricssonNov 2, 2012
  45. Michael J GruberNov 2, 2012
  46. Felipe ContrerasNov 2, 2012
  47. Michael J GruberNov 5, 2012
  48. Felipe ContrerasNov 5, 2012
  49. Felipe ContrerasNov 5, 2012
  50. Michael J GruberNov 5, 2012
  51. Felipe ContrerasNov 5, 2012
  52. Jonathan NiederNov 1, 2012
  53. Daniel BarkalowOct 31, 2012
  54. Felipe ContrerasNov 1, 2012
  55. Junio C HamanoNov 1, 2012
  56. Felipe ContrerasNov 1, 2012
  57. Felipe ContrerasOct 31, 2012
  58. Michael J GruberOct 31, 2012
  59. Felipe ContrerasOct 31, 2012
  60. Jeff KingNov 2, 2012
  61. Felipe ContrerasNov 2, 2012
  62. Felipe ContrerasNov 2, 2012
  63. Felipe ContrerasNov 4, 2012
  64. Thomas AdamNov 2, 2012
  65. Felipe ContrerasNov 2, 2012
  66. Felipe ContrerasOct 31, 2012
  67. Felipe ContrerasOct 31, 2012
  68. Felipe ContrerasNov 1, 2012
  69. Jeff KingNov 2, 2012
  70. Felipe ContrerasNov 2, 2012
  71. Felipe ContrerasNov 2, 2012
  72. Michael J GruberNov 5, 2012
  73. Felipe ContrerasNov 5, 2012
  74. Junio C HamanoNov 1, 2012
  75. Felipe ContrerasNov 1, 2012

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.