git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Expected Behavior?
@ 2005-11-09 13:38 Jon Loeliger
  2005-11-09 20:38 ` Junio C Hamano
  0 siblings, 1 reply; 31+ messages in thread
From: Jon Loeliger @ 2005-11-09 13:38 UTC (permalink / raw)
  To: git

> Could you check diff between /usr/bin/git-merge-recursive and
> git-merge-recursive.py in your source tree and see if the
> appending to sys.path points at the right place (i.e. where the
> make installs gitMergeCommon.py)?

    jdl.com 211 % diff /usr/src/git-core/git-merge-recursive /usr/bin/git-merge-recursive
    jdl.com 212 %

    jdl.com 213 % ll  /usr/src/git-core/git-merge-recursive /usr/bin/git-merge-recursive
    32 -rwxr-xr-x  1 root root 29181 Nov  8 20:17 /usr/bin/git-merge-recursive
    32 -rwxr-xr-x  1 jdl  src  29181 Nov  8 08:36 /usr/src/git-core/git-merge-recursive

This would be a problem, though:

    jdl.com 216 % head -15 /usr/bin/git-merge-recursive
    #!/usr/bin/python

    import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
    from heapq import heappush, heappop
    from sets import Set

    sys.path.append('''/home/jdl/share/git-core/python''')
    from gitMergeCommon import *

    originalIndexFile = os.environ.get('GIT_INDEX_FILE',
				       os.environ.get('GIT_DIR', '.git') + '/index')temporaryIndexFile = os.environ.get('GIT_DIR', '.git') + \
			 '/merge-recursive-tmp-index'
    def setupIndex(temporary):
	try:


Looks like /home/jdl/share got left instead of /usr/share.

So.  The root of the problem is that I followed the INSTALL
instructions:

		    Git installation

    Normally you can just do "make" followed by "make install", and that
    will install the git programs in your own ~/bin/ directory.  If you want
    to do a global install, you can do

	    make prefix=/usr install

I ran "make" as myself, and then later
I ran "make prefix=/usr install" as root.


However, the path substitution happened as part of the
"all" target and not as part of the "install" target:

    SCRIPT_PYTHON = \
	    git-merge-recursive.py

    SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
	      $(patsubst %.perl,%,$(SCRIPT_PERL)) \
	      $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
	      gitk git-cherry-pick

    all: $(PROGRAMS) $(SCRIPTS)

    $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
	    rm -f $@
	    sed -e '1s|#!.*python|#!$(call shq,$(PYTHON_PATH))|' \
		-e 's|@@GIT_PYTHON_PATH@@|$(call shq,$(GIT_PYTHON_DIR))|g' \
		-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
		$@.py >$@
	    chmod +x $@


So, It looks like either:

    1) Change the INSTALL documentation and process
       to require "make prefix=/...." also during the build,
or
    2) Change the Makefile to do install-related path
       substitutions at "make install" time.

My preference would be the latter (ie, take $(SCRIPTS) off
the "all: " line), but you may have better notions here.
Like, do people run stuff out of the build directory between
a "make" and a "make install"?  Dunno.

jdl

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: Expected Behavior?
@ 2005-11-09  2:58 Jon Loeliger
  2005-11-09  6:28 ` Junio C Hamano
  0 siblings, 1 reply; 31+ messages in thread
From: Jon Loeliger @ 2005-11-09  2:58 UTC (permalink / raw)
  To: git

<Young Frankenstein> Froe-derick wrote: </Young Frankenstein>

> Jon: You could try to this merge with the recursive merge strategy
> (git merge -s recursive 'merge message' master dev) If you do, you
> _should_ get something like:
> 
>     CONFLICT (add/add): File file3 added non-identically in both
>     branches. Adding as file3_master and file3_dev instead.

Hmmm. That didn't go too well. Concisely:

    % git merge -s recursive "Grab dev stuff" master dev
    Trying really trivial in-index merge...
    fatal: Merge requires file-level merging
    Nope.
    Traceback (most recent call last):
      File "/usr/bin/git-merge-recursive", line 8, in ?
	from gitMergeCommon import *
    ImportError: No module named gitMergeCommon
    Automatic merge failed/prevented; fix up by hand

Full details below.

> You will then end up with file3_master and file3_dev in your working
> tree, which corresponds to file3 in the master branch and file3 in the
> dev branch, respectively.

That'd be cool, because the first thing I tend to want to do
after a failed file merge is look at clear versions of both files.
Gives me a global sense of where the file needs to go...  You know.

jdl





[ tail end of the make install output ]

install -d -m755 '/usr/share/git-core/templates/'
(cd blt && tar cf - .) | \
(cd '/usr/share/git-core/templates/' && tar xf -)
make[1]: Leaving directory `/usr/src/git-core/templates'
install -d -m755 '/usr/share/git-core/python'
install gitMergeCommon.py '/usr/share/git-core/python'



% git merge -s recursive "Grab dev stuff" master dev
Trying really trivial in-index merge...
fatal: Merge requires file-level merging
Nope.
Traceback (most recent call last):
  File "/usr/bin/git-merge-recursive", line 8, in ?
    from gitMergeCommon import *
ImportError: No module named gitMergeCommon
Automatic merge failed/prevented; fix up by hand

% git -v
git version 0.99.9.GIT
% cat /usr/src/git-core/.git/HEAD
f8d294f0a44c4305a9f3a1c70beb6a1c7583f287


% ll /usr/share/git-core/python/
total 16
4 drwxr-xr-x  2 root root 4096 Nov  8 20:17 .
4 drwxr-xr-x  4 root root 4096 Sep 14 19:47 ..
8 -rwxr-xr-x  1 root root 6879 Nov  8 20:17 gitMergeCommon.py

% python
Python 2.3.5 (#2, May  4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: Expected Behavior?
@ 2005-11-08  3:43 Jon Loeliger
  2005-11-08  6:00 ` Junio C Hamano
  0 siblings, 1 reply; 31+ messages in thread
From: Jon Loeliger @ 2005-11-08  3:43 UTC (permalink / raw)
  To: git

> Yup, it uses "git-ls-files --others", which considers that
> unmerged paths do not "exist" in the index.  This is wrong.
> 
> The attached is a patch to fix ls-files.
> 
> I also think that file3 should not appear in "Updated but not
> checked in (will commit)" list -- we are _not_ going to commit
> unmerged paths until you tell git what you want to do with
> them.  The patch in the next message fixes it.

Patch looks good here!  Thanks!

    % git status
    #
    # Updated but not checked in:
    #   (will commit)
    #
    #       modified: file1
    #       deleted:  file2
    #
    #
    # Changed but not updated:
    #   (use git-update-index to mark for commit)
    #
    #       unmerged: file3
    #

But I have a lingering question.  Same script as before.

    % git diff file3
    * Unmerged path file3

    % cat file3
    Stuff for a conflict.

Why didn't file3 show something like:

    % cat file3
    <<<<<
    Stuff for a conflict.
    =====
    Another file!
    >>>>>

That is, after the merge, file3 appears to have simply kept
the contents of the current, master branch.  Why wasn't the
dev branch represented here?

I _almost_ think I get it, and then *poof*...

Thanks,
jdl

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: Expected Behavior?
@ 2005-11-08  3:07 Jon Loeliger
  0 siblings, 0 replies; 31+ messages in thread
From: Jon Loeliger @ 2005-11-08  3:07 UTC (permalink / raw)
  To: git


> It appears that as the everyday workhorse, using Daniel's
> git-merge-resolve is stable through git-merge have proven stable
> enough.  So here is a question.  Do people mind if 'git-resolve'
> and 'git-octopus' are dropped before 1.0?  This means 2 less
> programs in your /usr/bin ;-).

It's OK with me. :-)

jdl

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Expected Behavior?
@ 2005-11-06 22:16 Jon Loeliger
  2005-11-07  1:38 ` Junio C Hamano
  2005-11-07  2:01 ` Junio C Hamano
  0 siblings, 2 replies; 31+ messages in thread
From: Jon Loeliger @ 2005-11-06 22:16 UTC (permalink / raw)
  To: git


I was working through some examples and found some
rather curious behavior.  I'm wondering if it is
expected or not.  This isn't quite minimal, but
it is still small and shows the weirdness:

    git-init-db
    echo "Stuff for file1" > file1
    echo "Stuff for file2" > file2

    git add file1 file2
    git commit -m "Initial file1 and file2"

    git checkout -b dev

    echo "More for file1" >> file1
    rm -f file2
    echo "Another file!" > file3

    git update-index file1
    git update-index --force-remove file2
    git add file3

    git commit -m "Updated some stuff."

    git checkout master
    echo "Stuff for a conflict." >> file3
    git add file3
    git commit -m "Master update of file3"

    git merge "Grab dev stuff" master dev

Then, the part that I think is odd is demonstrated by "git status":

    $ git status
    #
    # Updated but not checked in:
    #   (will commit)
    #
    #       modified: file1
    #       deleted:  file2
    #       unmerged: file3
    #
    #
    # Changed but not updated:
    #   (use git-update-index to mark for commit)
    #
    #       unmerged: file3
    #
    #
    # Untracked files:
    #   (use "git add" to add to commit)
    #
    #       file3

Why is file3 considered untracked and needing to be added?
It was present in both "dev" and "master" branches before
the merge.  It doesn't end up with "<<< one === other >>>"
style diffs either.

My guess is that the file is small, one line, in each branch.
When the diff happens, it sees the file as empty in the other
branch and considers that "new" directly, rather than asking
the index if it knows about it to determine "newness" status.

Or perhaps it is that the file  became new in each branch
independently and never really had a true common ancestor.

Thanks,
jdl

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2005-11-10 23:22 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09 13:38 Expected Behavior? Jon Loeliger
2005-11-09 20:38 ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2005-11-09  2:58 Jon Loeliger
2005-11-09  6:28 ` Junio C Hamano
2005-11-08  3:43 Jon Loeliger
2005-11-08  6:00 ` Junio C Hamano
2005-11-08  9:56   ` Petr Baudis
2005-11-08 21:03   ` Fredrik Kuivinen
2005-11-08 21:41     ` Junio C Hamano
2005-11-08 22:53       ` Fredrik Kuivinen
2005-11-09  5:50         ` Junio C Hamano
2005-11-09  8:19           ` Fredrik Kuivinen
2005-11-10 20:34             ` Petr Baudis
2005-11-10 22:52               ` Junio C Hamano
2005-11-10 23:22                 ` Petr Baudis
2005-11-09 11:24     ` Petr Baudis
2005-11-09 23:04       ` Martin Langhoff
2005-11-09 23:12         ` Petr Baudis
2005-11-09 23:43           ` Martin Langhoff
2005-11-09 23:49             ` Petr Baudis
2005-11-10  2:47               ` Martin Langhoff
2005-11-10 19:34                 ` Petr Baudis
2005-11-10 19:54                   ` Martin Langhoff
2005-11-10 20:10                     ` Petr Baudis
2005-11-09 23:36         ` Junio C Hamano
2005-11-09 23:42           ` Petr Baudis
2005-11-10  0:03             ` Junio C Hamano
2005-11-08  3:07 Jon Loeliger
2005-11-06 22:16 Jon Loeliger
2005-11-07  1:38 ` Junio C Hamano
2005-11-07  2:01 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).