git mailing list

FromSubjectsort iconDate
David D. Kilzer
[PATCH] 3-way merge with file move fails when diff.renames =...
With diff.renames = copies, a 3-way merge (e.g. "git rebase") would fail with the following error: fatal: mode change for <file>, which is not in current HEAD Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001. The bug is a logic error added in ece7b749, which attempts to find an sha1 for a patch with no index line in build_fake_ancestor(). Instead of failing unless an sha1 is found for both the old file a...
Nov 10, 6:26 pm 2008
Junio C Hamano
Re: [PATCH] 3-way merge with file move fails when diff.renam...
Hmm. The logic introduced by the blamed commit makes the --index-info unreliable (I'd rather see it fail reliably if it does not have enough information rather than pretending everything is Ok), and I think the patch makes it slightly more so. If new_name that is not related at all to old_name happens to exist in the current tree you are applying the patch to, you can grab the contents of the unrelated file as the preimage and try to merge the changes in. When running --index-info for the pu...
Nov 10, 7:49 pm 2008
Johannes Schindelin
Re: [PATCH] 3-way merge with file move fails when diff.renam...
Hi, except for the commit subject I like it, especially the commit body. So: s/(3-way.*) fails/Fix &/ Ciao, Dscho --
Nov 10, 7:41 pm 2008
David D. Kilzer
[PATCH] Fix 3-way merge with file move when diff.renames = c...
With diff.renames = copies, a 3-way merge (e.g. "git rebase") with a file move would fail with the following error: fatal: mode change for <file>, which is not in current HEAD Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001. The bug is a logic error added in ece7b749, which attempts to find an sha1 for a patch with no index line in build_fake_ancestor(). Instead of failing unless an sha1 is found for bo...
Nov 10, 7:53 pm 2008
Martin Koegler
[PATCH] git push: Interpret $GIT_DIR/branches in a Cogito co...
Current git versions ignore everything after # (called <head> in the following) when pushing. Older versions (before cf818348f1ab57), interpret #<head> as part of the URL, which make git bail out. Ignoring the <head> part for push (fetch respects them) is unlogical. As branches origin from Cogito, it is the best to correct this by using the behaviour of cg-push: push HEAD to remote refs/heads/<head> Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> --- ...
Nov 10, 5:47 pm 2008
Junio C Hamano
Re: [PATCH] git push: Interpret $GIT_DIR/branches in a Cogit...
This message was addressed to me, but is it meant for inclusion? I do not recall seeing an agreement on what the desired behaviour should be from (ex-)Cogito users, if this change of behaviour hurts real world usage of existing git users, andr if so how we ease this change in to the release. While I'd personally agree matching with whatever cg-push used to do might make the most sense in the end, I am not sure changing of behaviour abruptly like this is a good idea. I am also not so sure url...
Nov 10, 7:25 pm 2008
Fedor Sergeev
overly smart rebase - bug or feature?
Folks, I have recently hit a behavior which might well be a feature, but it was very surprising (in a bad sense) to me. I was trying to rebase a branch with changes in some file onto a branch where this file was recently deleted. I would expect rebase to fail and suggest me to resolve conflict manually. However it somehow succeeded managing to find another file to patch instead of the initial one: ] cat git-rebase-bug.sh #!/bin/sh git init # create three files with the same contents pe...
Nov 10, 5:23 pm 2008
Junio C Hamano
Re: overly smart rebase - bug or feature?
It is a feature misfiring. Rebase is essentially a repeated cherry-pick, and a cherry-pick of commit A on top of commit B is done by a simplified 3-way merge between A and B using the parent of A as the common ancestor. A A' / / A^... pseudo history ...---B When your history has renamed Makefile to Makefile2 (thereby losing Makefile) while transition from A^ to A modified Makefile, the difference between A^ to A that is applied t...
Nov 10, 7:14 pm 2008
Fedor Sergeev
Re: overly smart rebase - bug or feature?
Well, my history is exactly that, not pseudo (and I dont quite follow your reasoning yet to understand whether this is important or not): A B \ / A^ My history did not rename Makefile. There were three identical Makefiles (in A^) After that one was deleted (in B). On alternative branch it was edited (in A). If I do *merge* A into B then it fails. If I do *cherry-pick* A into B then it fails. There was no rename. There was a copy in initial commit (and you cant say if i...
Nov 10, 7:36 pm 2008
Junio C Hamano
Re: overly smart rebase - bug or feature?
Simplified one is not _smarter_. It is merely _faster_, exactly because it only looks at the paths between A^..A and nothing else. And that is why it cannot tell between the case where both A^ and A have Makefile2 or they both lack it. And that is exactly why application of this change on top of B is mistaken as a patch to a renamed path. From B's point of view: - Incoming change says "I changed Makefile from this shape to that shape", and nothing else; - B does not have Makefile, bu...
Nov 10, 7:57 pm 2008
Avery Pennarun
Re: overly smart rebase - bug or feature?
But isn't rename detection in this case rather suspicious, since: - the preimage already had Makefile, Makefile1, and Makefile2, thus it is not a rename, but at most a copy, and not even a newly-created copy in either branch; - *two* different files match the original Makefile, but rebase has randomly selected one but not the other; - (I haven't verified this claim) cherry-pick and merge both correctly identify the problem as a delete/modify conflict? It seems that rebase should have baile...
Nov 10, 7:31 pm 2008
Junio C Hamano
Re: recognize loose local objects during repack
Thanks. Looked alright from a cursory reading. By the way, I've been meaning to suggest that we should straighten out the semantics of "unpacked" vs "incremental". What the latter means is quite clear. We are creating a new packfile to bundle loose ones into one, and after the new packfile is installed we can remove the loose objects. But what --unpacked means often confuses people, primarily because it is a performance heuristics that makes certain assumptions on how the objects are packe...
Nov 10, 5:03 pm 2008
Miklos Vajna
[PATCH 3/4] git-remote rename: support branches->config m...
This is similar to the remotes->config one, but it makes the branches->config conversion possible. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> --- builtin-remote.c | 2 ++ t/t5505-remote.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/builtin-remote.c b/builtin-remote.c index d9d0ba3..3af1876 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -384,6 +384,8 @@ static int migrate_file(struct remote *remote) remote->...
Nov 10, 4:43 pm 2008
Miklos Vajna
[PATCH 4/4] git-remote: document the migration feature of th...
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> --- Documentation/git-remote.txt | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index 7b227b3..fad983e 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -66,6 +66,10 @@ was passed. Rename the remote named <old> to <new>. All remote tracking branches and configuration settings for the remote are updated. ...
Nov 10, 4:43 pm 2008
Daniel Lowe
[PATCH] Fixed non-literal format in printf-style calls
These were found using gcc 4.3.2-1ubuntu11 with the warning: warning: format not a string literal and no format arguments --- builtin-check-attr.c | 2 +- builtin-remote.c | 2 +- bundle.c | 4 ++-- environment.c | 2 +- fsck.c | 2 +- grep.c | 6 +++--- hash-object.c | 2 +- path.c | 4 ++-- refs.c | 2 +- unpack-trees.c | 2 +- 10 files changed, 14 insertions(+), 14...
Nov 10, 3:15 pm 2008
Brandon Casey
Re: [PATCH] Fixed non-literal format in printf-style calls
Daniel Lowe wrote: Perhaps these should by changed to use fputs() instead. and these should use strlcpy. -brandon --
Nov 10, 3:47 pm 2008
Daniel Lowe
[PATCH] Fixed non-literal format in printf-style calls
These were found using gcc 4.3.2-1ubuntu11 with the warning: warning: format not a string literal and no format arguments Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>. --- builtin-check-attr.c | 2 +- builtin-remote.c | 2 +- bundle.c | 4 ++-- environment.c | 2 +- fsck.c | 2 +- grep.c | 6 +++--- hash-object.c | 2 +- path.c | 4 ++-- refs.c | 2 ...
Nov 10, 5:07 pm 2008
Francis Galiegue
[PATCH] very small cleanup: #undef a macro that isn't used a...
In xdiff-interface.c, the FIRST_FEW_BYTES macro is defined, is never used anwhere else, so we might as well undefine it after we're done with it. --- xdiff-interface.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/xdiff-interface.c b/xdiff-interface.c index e8ef46d..2cf30cd 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -226,6 +226,7 @@ int buffer_is_binary(const char *ptr, unsigned long size) size = FIRST_FEW_BYTES; return !!memch...
Nov 10, 2:28 pm 2008
Johannes Schindelin
Re: [PATCH] very small cleanup: #undef a macro that isn't us...
Hi, Would not the consequence be that we end up with a ton of #undefines all over the place, reducing readability incredibly? Ciao, Dscho --
Nov 10, 3:09 pm 2008
Francis Galiegue
Re: [PATCH] very small cleanup: #undef a macro that isn't us...
Hmwell, this is a twofold argument, I guess... * for: the macro is defined, not undefined: it means that potentially, it can be used somewhere else in the file; but it isn't (in this case); * against: macros defined in a C file only ever have scope in said file (unless so mischievous Makefile cats two C files together before compile and file order is important -- but git doesn't do that), so why #undefine anything? Personally, I'm with the first argument. YMMV, of course. -- fge -- ...
Nov 10, 3:09 pm 2008
Michal Nazarewicz
Re: Something like $Id$, $Revision$ or $Date$?
Earlier in the thread there was following code for a pre-commit hook mentioned: #v+ files=3D$(git diff-index --name-only --diff-filter=3DAM HEAD) perl -pi -e 's/\$Id.*?\$/\$Id: '$(TZ=3DUTC date +%s)' \$/g' $files git add $files #v- Now, this meats all my needs except that (i) it adds all the files that were modified (ie. makes `git commit` work like `git commit -a`) and (ii) it modifies files even if the commit was aborted. So, it seems that, what I need is: (i) a pre-commit-post-message...
Nov 10, 1:38 pm 2008
Jakub Narebski
Re: Something like $Id$, $Revision$ or $Date$?
Well, in that case using `ident` attribute would be enough (but cryptic). # set `ident` attribute for all files $ echo '* ident' > .gitattributes # check that it is set for file 'foo' $ git check-attr ident -- foo foo: ident: set # edit file to contain '$Id$' keyword $ cat foo ... ... $Id$ ... ... # make a commit $ git commit -a # $Id$ keyword is replaced on checkout $ git add foo $ git checkout foo # and check that it got replaced $ cat foo ... ... $I...
Nov 10, 2:03 pm 2008
Michal Nazarewicz
Re: Something like $Id$, $Revision$ or $Date$?
Yes, but it forces me to do some voodoo magic (ie. checkout) to get the Id in the file, ;) like so: #v+ $ echo '$Id$' >bar && git add bar && git commit -m 'Added bar' && cat bar Created commit d49d436: Added bar 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 bar $Id$ $ rm bar && git checkout bar && cat bar $Id: 055c8729cdcc372500a08db659c045e16c4409fb $ #v- But never mind, since it seems hard to accomplish in git, I'll have t...
Nov 10, 4:00 pm 2008
Jakub Narebski
Re: Something like $Id$, $Revision$ or $Date$?
Well, _some_ command has to be invoked to expand keywords. "git add" doesn't do that (perhaps it should?), so you need to use checkout. And checkout doesn't touch file if it is identical, so you need to remove it first; nevertheless you don't need to use commit in betwen, as "git checkout bar" would checkout file out of index (you added contents of file to index with "git add bar"). -- Jakub Narebski Poland --
Nov 10, 4:17 pm 2008
Francis Galiegue
Re: Something like $Id$, $Revision$ or $Date$?
If "git add" aims to do that, you'd have to be very, VERY careful, not to substitute in the wrong place to start with, not to attempt substitution in binary files... And this would have a sizeable cost, imho. If you really want to do this, isn't there a hook somewhere that can do that for you, instead of modifying git add directly? -- Francis Galiegue ONE2TEAM Ingénieur système Mob : +33 (0) 6 83 87 78 75 Tel : +33 (0) 1 78 94 55 52 fge@one2team.com 40 avenue Raymond Poincaré 751...
Nov 10, 4:24 pm 2008
Jakub Narebski
Re: Something like $Id$, $Revision$ or $Date$?
If I remember correctly there was idea to add 'pre-add' or 'post-add' hook... -- Jakub Narebski Poland --
Nov 10, 4:32 pm 2008
Brian Gernhardt
Re: Something like $Id$, $Revision$ or $Date$?
Without adding any additional hooks, you could use the post-commit hook to look for any added/changed files containing $Id$ lines and force a checkout of them. Perhaps something as simple as the following in your .git/hooks/post- commit (untested, caveat emptor, YMMV): git diff --name-only --diff-filter=AM HEAD^ HEAD | \ while read file; do rm "$file" && git checkout -- "$file" end ~~ Brian--
Nov 10, 4:58 pm 2008
Thomas Harning
Git Notes - Track rebase/etc + reverse-lookup for bugs ideas
Just wondering, has there been any looking into whether the git-notes concept can track rebases? Reading over what git-notes is leads me to think it could be a good mechanism for the distributed bug-tracking idea I had some time ago. The only gotcha I see is that there would have to be some reverse mapping / fast lookup to track the commit objects that given notes are attached to.... and to facilitate individual assignment... notes applied to notes. Example structure: Commits A ...
Nov 10, 1:37 pm 2008
Jeff King
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
Not that I know of, but then again, I'm not sure exactly what you mean You can really think of the notes facility as a way of mapping SHA1 -> SHA1. So the oft-discussed concept of "attach some text to this commit" would be a commit sha1 mapping to a blob that contains the text. You have the commit, and you want to look up the attached text. How fast you can do a reverse lookup depends on what you are given. If you are saying "I want to look through the list of all notes, and see which comm...
Nov 10, 3:11 pm 2008
Johannes Schindelin
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
Hi, I guess he means that you could have something like this rebased from <SHA-1> in the notes for any given commit, so that _if_ you have the commit, e.g. gitk could show that connection (maybe dashed in the graphical history display, and as a "Rebased from:" link). Ciao, Dscho --
Nov 10, 3:51 pm 2008
Thomas Harning
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
What I intended is that if notes are attached to 'A', A` (after a rebase) will have the exact same note. --
Nov 10, 4:26 pm 2008
Jeff King
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
You don't really need "notes" for that, though, since you can put that information into the commit message (or headers) if you choose. I guess it has the advantage of not polluting the commit for others. -Peff --
Nov 10, 3:51 pm 2008
Johannes Schindelin
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
Hi, Exactly. And it would have the nice side effect that you could use a notes ref "rebases", and just not show it when you are not interested in looking at rebases. Ciao, Dscho --
Nov 10, 4:48 pm 2008
Johan Herland
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
Does it make sense to teach "git rebase" the -x option from "git cherry-pick"? As with "git cherry-pick -x" it only makes sense to use it if your rebasing from a public branch. Have fun! ...Johan -- Johan Herland, <johan@herland.net> www.herland.net --
Nov 10, 4:01 pm 2008
Miklos Vajna
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
On Mon, Nov 10, 2008 at 09:01:15PM +0100, Johan Herland <johan@herland.net>= But rebasing a public branch is always something we try to prevent. So basically -x would be useful only in case the user does what we asked not to do. ;-)
Nov 10, 4:34 pm 2008
Johan Herland
Re: Git Notes - Track rebase/etc + reverse-lookup for bugs i...
Sorry, I wasn't clear enough: I am talking about a copy-rebase, that is, the original public branch is unchanged, but you copy patches from it by making a local temporary branch that starts out in the same place and then rebasing it onto the other public branch where your want the patches to end up (followed by fast-forwarding the target branch and removing the temp branch). This is basically identical to cherry-picking a range of commits, but since "git cherry-pick" does not support cherry-pi...
Nov 10, 5:51 pm 2008
Santi Béjar
git commit -v does not removes the patch
Hi *, $subject since: 4f672ad (wt-status: load diff ui config, 2008-10-26) I tried to make a test case, but failed. I think because it is a bit tricky the fake_editor/stdin/stdout stuff, so at the end I bisected it by hand Regards, Santi --
Nov 10, 11:20 am 2008
Jeff King
Re: git commit -v does not removes the patch
Sorry, I don't quite understand what the problem is. From reading your subject line, I expected that "git commit -v" would show the diff in your editor, but then accidentally also include it in the final commit message. But I can't seem to reproduce that. Can you describe the problem in more detail? -Peff --
Nov 10, 2:10 pm 2008
Santi Béjar
Re: git commit -v does not removes the patch
It is exactly as you described. I'll try in other systems. Santi --
Nov 10, 6:34 pm 2008
Junio C Hamano
Re: git commit -v does not removes the patch
Guess in the dark... by any chance are you enabling color unconditionally? --
Nov 10, 7:27 pm 2008
Francis Galiegue
JGIT: discuss: diff/patch implementation
Hello, A very nice git feature, without even going as far as merges, is the cherry pick feature. For this to be doable from within the Eclipse Git plugin, a diff/patch implementation needs to be found, in a license compatible with the current JGit license (3-clause BSD, as far as I can tell). Or a new implementation can be rewritten from scratch, of course. I found this: http://code.google.com/p/google-diff-match-patch Its license is the Apache 2.0 license. It implements the same algo...
Nov 10, 10:22 am 2008
Junio C Hamano
Re: JGIT: discuss: diff/patch implementation
I thought cherry-picking needs to be done in terms of 3-way merge, not diff piped to patch, for correctness's sake. --
Nov 10, 4:50 pm 2008
Johannes Schindelin
Re: JGIT: discuss: diff/patch implementation
Hi, I haven't checked how RCS merge does it, but I know how xdiff/xmerge.c does it ;-) Basically, it takes the two diffs relative to the base file and works on the overlapping hunks (i.e. on hunks where the ranges in the base file overlap). So we need a diff algorithm very much if we were to imitate that code in JGit, which I very much plan to do. Ciao, Dscho --
Nov 10, 7:37 pm 2008
Shawn O. Pearce
Re: JGIT: discuss: diff/patch implementation
Yea, the 3-way merge cherry-pick is better. But in a pinch you can (usually) get correct results from a "diff | patch" pipeline. Of course that doesn't always work, resulting in patches that don't apply cleanly, or worse, that apply at the wrong place silently. -- Shawn. --
Nov 10, 4:52 pm 2008
Francis Galiegue
Re: JGIT: discuss: diff/patch implementation
Well, in this case, I'd say it's a case of a bottle being "half full" or "half empty". The availability of even a simple diff|patch in jgit, and its being available in egit, would generally be seen as a "half full" bottle, and would, imho, GREATLY increase the appeal factor of egit, all the more that you have plenty of undo/redo ability in Eclipse... And, dare I say it, of git in general as an SCM to be used in many environments where Eclipse is the de facto IDE. I know, I may sound irrita...
Nov 10, 5:31 pm 2008
Johannes Schindelin
Re: JGIT: discuss: diff/patch implementation
Hi, Do not forget creating efficient packs. They also need an efficient diff Nice. As was pointed out already, it is more meant to work on text than I'd like to, and it also seems to have cute DWIMery for HTML. I did not find any implementation, so I started implementing my own version of Gene Myers' algorithm, with the plan to extend it with a patience diff option. My code so far can generate a diff between two files, but does not use O(D) space (where D is the number of differen...
Nov 10, 3:46 pm 2008
Francis Galiegue
Re: JGIT: discuss: diff/patch implementation
I wasn't even thinking about this, honestly :p Let's say that as far as IDE users are concerned, they do have disk space, and having the ability to cherry-pick is more of a priority than packs ;) Even a less efficient but "to the point" engine will be good enough for the time being, or at least, this is what I think. I understand way too little about the algorithm myself to tell whether it's also efficient for such a purpose. Maybe it is... -- fge --
Nov 10, 4:21 pm 2008
Robin Rosenberg
Re: JGIT: discuss: diff/patch implementation
Our approach was to do just that, for the very reasons you mention. I'll have a look. Thanks for doing some research for us. That project was unknown to me.. -- robin --
Nov 10, 11:56 am 2008
Francis Galiegue
Re: JGIT: discuss: diff/patch implementation
Le Monday 10 November 2008 16:56:35 Robin Rosenberg, vous avez écrit : Well, this API has a problem from the get go, since it does... Char by char comparison. Ouch. I'll try and hack it so that it does line by line, but given my Java skills, uh... -- fge --
Nov 10, 12:16 pm 2008
Robin Rosenberg
Re: JGIT: discuss: diff/patch implementation
We might want a byte-oriented version. Converting to char first is way too slow. -- robin --
Nov 10, 12:59 pm 2008
previous daytodaynext day
November 9, 2008November 10, 2008November 11, 2008