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

Re: Need help migrating workflow from svn to git.

From
JWJosef Wolf <jw@raven.inka.de>
Date
Dec 20, 2017, 11:43 UTC
Message-ID
<20171220114337.GE18542@raven.inka.de>
In-Reply-To
<19d67f01-5e7d-3792-52f4-52da86bca5e5@gmail.com>

Thanks to you both for your patience with me. Sorry for the late reply, my day job was needing me ;-)

On Fri, Dec 15, 2017 at 07:58:14PM +0100, Igor Djordjevic wrote:
> On 15/12/2017 17:33, Junio C Hamano wrote:
> > 
> >     $ git fetch <remote> <branch>
> >     $ git checkout -m -B <master> FETCH_HEAD

For some reason, this seems to double the local modifications. After executing the following commands:

  rm -rf reposA reposB
  
  git init reposA
  (
    cd reposA
    echo 1 >>1
    echo 2 >>2
    git add 1 2
    git commit -m1
  )
  
  git clone reposA reposB
  
  (
    cd reposA
    echo 1 >>1
    git commit -a -m2
  )
  
  (
    cd reposB
    echo 3 >>2
    git fetch
    git checkout -m -B master FETCH_HEAD
  )
git-diff gives me:
  $ diff --git a/2 b/2
  index 0cfbf08..4e8a2de 100644
  --- a/2
  +++ b/2
  @@ -1 +1,3 @@
   2
  +3
  +3
With Igor's set of commands, I did not see this doubling:
Show 7 quoted lines
>     git checkout -b temp &&               #1
>     git fetch &&                          #2
>     git branch -f master origin/master && #3
>     git checkout -m master &&             #4
>     git add -u &&                         #5
>     git reset &&                          #6
>     git branch -d temp                    #7
Show 10 quoted lines
> ... aaand that`s how you do it[1] without a temporary branch :)
> 
> Junio, what about consecutive runs, while merge conflicts are still 
> unresolved?
> 
> Seeing Josef having a pretty relaxed flow, and his cron job running 
> every 15 minutes, would adding something like:
> 
>     $ git add -u
>     $ git reset
This would be added after the "git checkout -m -B master FETCH_HEAD" command?
Show 6 quoted lines
> ... to the mix, to "silence" actually still unresolved merge 
> conflicts, making next script execution possible, make sense?
> 
> Yes, `git diff` won`t be the same as if conflicts were still in, but 
> it might be worth it in this specific case, conflicting parts still 
> easily visible between conflict markers.

That means, the conflict is still there, but git would think this is an ordinary modification?

-- 
Josef Wolf
jw@raven.inka.de
Previous: Josef WolfNext: Josef Wolf
Message 14 of 16 in “Need help migrating workflow from svn to git.”
  1. Josef WolfDec 14, 2017
  2. Randall S. BeckerDec 14, 2017
  3. Josef WolfDec 15, 2017
  4. Igor DjordjevicDec 14, 2017
  5. Igor DjordjevicDec 15, 2017
  6. Josef WolfDec 15, 2017
  7. Josef WolfDec 15, 2017
  8. Igor DjordjevicDec 15, 2017
  9. Junio C HamanoDec 15, 2017
  10. Igor DjordjevicDec 15, 2017
  11. Junio C HamanoDec 15, 2017
  12. Igor DjordjevicDec 15, 2017
  13. Josef WolfDec 20, 2017
  14. Josef WolfDec 20, 2017
  15. Josef WolfDec 20, 2017
  16. Igor DjordjevicDec 21, 2017

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.