[Bug 4935] New: hg convert on Git repository doesn't follow all refs/tags.

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Nov 4 12:34:24 UTC 2015


https://bz.mercurial-scm.org/show_bug.cgi?id=4935

            Bug ID: 4935
           Summary: hg convert on Git repository doesn't follow all
                    refs/tags.
           Product: Mercurial
           Version: 3.5.2
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: convert
          Assignee: bugzilla at selenic.com
          Reporter: gavenkoa at gmail.com
                CC: durin42 at gmail.com, mercurial-devel at selenic.com

In order to make some comparing Hg and Git capabilities I try to build common
history to compare on (I use public repository so it is easy to reproduce):

  $ git co https://github.com/jquery/jquery.git
  $ cd jquery
  $ git log --tags --oneline --decorate --all --simplify-by-decoration --graph 

  70605c8 (origin/master, origin/HEAD) Ajax: Only form-encode requests with a
body
  47ccf3d (HEAD -> master) Attributes: do not set properties to false when
removing booleans
  8339185 (origin/compat) Tests: Make regexes for iOS devices more rigid
  90347a7 (origin/killphp) Tests: first step in using a node-based test server:
static files
  f9846ae (tag: 3.0.0-alpha1) 3.0.0-alpha1
  ef64d82 (tag: 3.0.0-alpha1+compat) 3.0.0-alpha1+compat
  ff619f3 (origin/1.11-stable) Build: Updating the 1.11-stable version to
1.11.4-pre.
  1472290 (tag: 1.11.3) 1.11.3
  c0fd6a9 (origin/2.1-stable) Build: Updating the 2.1-stable version to
2.1.5-pre.
  7751e69 (tag: 2.1.4) 2.1.4
  8f2a9d9 (tag: 2.1.3) 2.1.3
  9690801 (tag: 1.11.2) 1.11.2
  a04f5ff (tag: 2.1.2) 2.1.2
  0d5ec2d (tag: 1.11.1) 1.11.1
  4dec426 (tag: 2.1.1) 2.1.1
  b50c9a8 (tag: 1.11.1-rc2) 1.11.1-rc2

  $ grep refs/tags .git/packed-refs 
  ...
  a04f5ff9795fd6292117563623db44cf3f875868 refs/tags/2.1.2
  8f2a9d9272d6ed7f32d3a484740ab342c02541e0 refs/tags/2.1.3
  7751e69b615c6eca6f783a81e292a55725af6b85 refs/tags/2.1.4
  f9846aec1dadc4bc80ca2df47d3ecc1b9f7a4f84 refs/tags/3.0.0-alpha1
  ef64d82ec3d1717478979cba986d896aa0dda617 refs/tags/3.0.0-alpha1+compat


  $ cd ..
  $ hg convert jquery jquery-hg
  $ cd jquery-hg
  $ hg log -r 'tag()' --template '{date|isodate} {tags}\n'
  ...
  2013-05-09 21:16 -0400 1.10.0-beta1
  2013-09-19 16:04 -0400 1.11.0-beta1
  2013-01-14 23:19 -0500 2.0.0b1
  2013-03-01 13:50 -0500 2.0.0b2
  2013-04-09 08:10 -0400 2.0.0-beta3
  2013-09-19 16:15 -0400 2.1.0-beta1

As you can see there are no any recent tags in Hg history.

I think that old tags here only because tag ten on the path from "zero"
revision to "master":

    $ git log --graph  --decorate --simplify-by-decoration --oneline --all
    * 70605c8 (origin/master, origin/HEAD) Ajax: Only form-encode requests with
a body
    * 47ccf3d (HEAD -> master) Attributes: do not set properties to false when
removing booleans
    | * 8339185 (origin/compat) Tests: Make regexes for iOS devices more rigid
    | | * f9846ae (tag: 3.0.0-alpha1) 3.0.0-alpha1
    | |/  
    |/|   
    ...
    * | 1185427 (tag: 2.1.0-beta1) Tagging the 2.1.0-beta1 release.

Newer tags made on branches from "master" path and doesn't present in converted
repository.

Official docs says:

  $ hg help convert

    Git Source
    ##########

    The Git importer converts commits from all reachable branches (refs in
    refs/heads) and remotes (refs in refs/remotes) to Mercurial.

But in real-world repositories that strip valuable history. Mercurial SHOULD
preserve refs/tags also!

If there are arguments against importing 'refs/tags' by default we need option
to support preserving tag history.

There are a lot of such repositories where tags get on sepatate brancjes
instead of baseline. Most from CSS/JS libraries/frameworks which commit build
artifacts (compiled/minified code) to tag release in order to keep clean
history in mainline (master). With build artifacts in mainline you end with
all-on-all several MiB diffs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list