<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>31479</bug_id>
          
          <creation_ts>2015-11-12 18:28:16 +0300</creation_ts>
          <short_desc>gear-clone configures fetch differently from the default result of &quot;git remote add&quot;</short_desc>
          <delta_ts>2015-11-13 13:35:48 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>mithraen-build-utils</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>31482</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>153667</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-12 18:28:16 +0300</bug_when>
    <thetext>mithraen-build-utils-0.1.27-alt1

While using gear-clone, I&apos;ve noticed that the fetch rule for origin works differently from how the default one created by &quot;git remote add&quot; works.

As a result, some unexpected not nice things happen. For example, I get duplicate remote refs for the refs from origin (probably because of the default operation of &quot;git push&quot;):

~/TOOLS/vc/girar-nmu/girar-nmu $ git branch -r | fgrep sisyphus
  origin/HEAD -&gt; origin/sisyphus
  origin/heads/sisyphus
  origin/sisyphus
~/TOOLS/vc/girar-nmu/girar-nmu $ 

Is this done consciously for some reason? Or this could be done in the standard way?

The current code:

git --git-dir=&quot;.git&quot; config &apos;remote.origin.fetch&apos; &quot;refs/heads/*:refs/remotes/origin/heads/*&quot;

The suggested standard behavior:

git --git-dir=&quot;.git&quot; config &apos;remote.origin.fetch&apos; &quot;refs/heads/*:refs/remotes/origin/*&quot;

An example of the configuration after &quot;git remote add viy@ALT git.alt:/people/viy/packages/girar-nmu.git&quot; -- there is no &quot;heads&quot; infix:

[remote &quot;viy@ALT&quot;]
	url = git.alt:/people/viy/packages/girar-nmu.git
	fetch = +refs/heads/*:refs/remotes/viy@ALT/*

The configuration currently created by gear-clone:

[remote &quot;origin&quot;]
	url = git.alt:packages/girar-nmu
	fetch = refs/heads/*:refs/remotes/origin/heads/*
	push = refs/heads/*:refs/heads/*

What do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153668</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-12 18:34:40 +0300</bug_when>
    <thetext>You can pull this change from http://git.altlinux.org/people/imz/packages/?p=mithraen-build-utils.git;a=commit;h=3fc0747553a1a016e5200e0c13c480bdbf70670d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153669</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-12 18:36:39 +0300</bug_when>
    <thetext>Amended: http://git.altlinux.org/people/imz/packages/?p=mithraen-build-utils.git;a=commit;h=c342effc44979fd93a657820a002836dba5dcb2c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153693</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2015-11-13 13:30:31 +0300</bug_when>
    <thetext>mithraen-build-utils-0.1.28-alt1 -&gt; sisyphus:

* Fri Nov 13 2015 Denis Smirnov &lt;mithraen@altlinux&gt; 0.1.28-alt1
- gear-clone: fix origin remote config (ALT #31479)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153696</commentid>
    <comment_count>4</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-13 13:35:48 +0300</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>