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

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

    <bug>
          <bug_id>31482</bug_id>
          
          <creation_ts>2015-11-13 12:06:46 +0300</creation_ts>
          <short_desc>girar-nmu-helper-clone-and-setup-build-commit configures fetch differently from the default result of &quot;git remote add&quot;</short_desc>
          <delta_ts>2015-11-13 19:27:47 +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>girar-nmu</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>
          <dependson>31479</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="viy">viy</assigned_to>
          <cc>viy</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>153682</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-13 12:06:46 +0300</bug_when>
    <thetext>girar-nmu-1.27-alt1

Look at the code of girar-nmu-helper-clone-and-setup-build-commit (probably, inherited from gear-clone):

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

This does not follow the default behavior of &quot;git remote add&quot; (see the details below). What do you think?

+++ This bug was initially created as a clone of Bug #31479 +++

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>153684</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-13 12:49:48 +0300</bug_when>
    <thetext>Suggested fix:

http://git.altlinux.org/people/imz/packages/girar-nmu.git?p=girar-nmu.git;a=commitdiff;h=aeac03feefc254373df271a6a9b36ba22a1aa670

--- a/girar-nmu-helper-clone-and-setup-build-commit
+++ b/girar-nmu-helper-clone-and-setup-build-commit
@@ -45,7 +45,7 @@ girar-clone-build-commit \
 pushd  &quot;$localgitdir&quot; || exit -1
 git --git-dir=&quot;.git&quot; config &apos;remote.origin.url&apos; &quot;git.alt:packages/$name&quot;
 git --git-dir=&quot;.git&quot; config &apos;remote.origin.push&apos; &quot;refs/heads/*:refs/heads/*&quot;
-git --git-dir=&quot;.git&quot; config &apos;remote.origin.fetch&apos; &quot;refs/heads/*:refs/remotes/origin/heads/*&quot;
+git --git-dir=&quot;.git&quot; config &apos;remote.origin.fetch&apos; &quot;+refs/heads/*:refs/remotes/origin/*&quot;
 gear-rules-restore-branches
 
 : &lt;&lt;&apos;__EOF__&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153698</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-11-13 14:11:58 +0300</bug_when>
    <thetext>mitharen@ has reviewed and approved this fix (in mithraen-build-utiils) in https://bugzilla.altlinux.org/show_bug.cgi?id=31479 , so I go ahead and build a new release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153704</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2015-11-13 15:46:25 +0300</bug_when>
    <thetext>girar-nmu-1.27-alt2 -&gt; sisyphus:

* Fri Nov 13 2015 Ivan Zakharyaschev &lt;imz@altlinux&gt; 1.27-alt2
- girar-nmu-helper-clone-and-setup-build-commit: configure the remote
  in a standard way (like &quot;git remote add&quot; does; ALT#31482).
- minor tweaks in the code:
  - factored out git://git.altlinux.org/gears and
    git://git.altlinux.org/srpms as variables (to become environment
    parameters in future).
  - typo in documentation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153706</commentid>
    <comment_count>4</comment_count>
    <who name="viy">viy</who>
    <bug_when>2015-11-13 19:27:00 +0300</bug_when>
    <thetext>Спасибо!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>153707</commentid>
    <comment_count>5</comment_count>
    <who name="viy">viy</who>
    <bug_when>2015-11-13 19:27:47 +0300</bug_when>
    <thetext>Сорри, что вовремя не среагировал, после обеда отлучился по делам.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>