login
Header Space

 
 

Re: [PATCH 6/6] Add git-rewrite-commits

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <skimo@...>
Cc: <git@...>, Junio C Hamano <gitster@...>
Date: Sunday, July 15, 2007 - 8:38 pm

Hi,

On Sun, 15 Jul 2007, Sven Verdoolaege wrote:


*Sigh*  I hate to repeat arguments.


Yes.  And it is extremely hard to follow through your code, just to verify 
that it really works.  Using ALLOC_GROW instead of trying to play cute 
games would spare these tours, and I am quite convinced that it makes for 
less bugs.  If not now, then when somebody _else_ than you touches the 
code.


Right.  I did not complete that sentence.  But isn't it obvious?  Usually, 
you put in short, but (at least for some time) _unambiguous_ short names.  
IMHO people would expect the same to be true of rewritten commit messages.


Yes, I saw that.  Just wanted to remind you that some people might 
consider this a bug.


Okay, I'll try again.  You do not use the canonical form.  Why not use 
it, if only for consistency?  Besides, if you want to be able to override 
it with a command line option, you _will_ have to canonicalise _that_ 
original_prefix.


Yes, it could.


AFAICT TREECHANGE means that parents were rewritten.


You meant the TREECHANGE bit?  No.

BTW what do you plan to do about my objection to UNINTERESTING, given the 
example "git rewrite-commits A..B x/y"?


I did not understand that intention.  Maybe I am too dumb, that's all.


Didn't I mention that it was a severe limitation to think of the sha1 
mapping of a 1-to-1 mapping?  Think of it more as a relation.


I doubt that.  What would you expect a code

	get_tagged_commit(commit);
	tag_commit(tag, commit);

to do, if not tag a tagged commit _again_?  So I bet if it wasn't your 
code to begin with, you would have experienced the same confusion as me.


Because it is called rewrite-commits, not 
rewrite-all-refs-that-touch-this-commit-range.


Only touch the positive refs given in the command line.  If you say 
"--all", then it's all.  If you say "A..B", then it's "B".


I still have the superproject splitting as the main application in mind.  
Only for big applications like these does the performance improvement of 
rewrite-commits over filter-branch buy us anything.


Sorry, this explanation does not help me.  My impression was that a pruned 
commit should be _mapped_ to the rewritten sha1s of the original parents, 
but not be rewritten.


Yes, I mean unlinking an opened file.


It takes a few minutes to verify that the correct calls to add_sha1_map() 
are done in every case.

Also, why should commit->parents be reset only in the multiple-sha1 case?

But most seriously, why do you replace the _parents_ of a given commit by 
the sha1s of the _rewritten_ commits?  They are not even the rewritten 
_parents_.


But the code does not reflect that in some parts.  For example when you 
call "get_rewritten_sha1(sha1);" which one is it?  And what is it if the 
commit was rewritten to no commit at all, i.e. the history was cut 
forcefully?


Hmm.  You play with them pretty heavily, then, for example when you just 
reset commit->parents.


Umm.  Sorry to ask so bluntly: are you planning to change that?


IMHO the first part should be in the initial commit of 
builtin-rewrite-commits.c, so I will not do that.


No, it would not, because it is not valid C.


We are pretty anal about not losing data too quickly, and possibly 
unwantedly.

It would be surprising to me if this would be the first program to change 
that behaviour.

IOW, refs/original/ is not a temporary directory that you easily blow 
away.  It is meant for the user to be inspected.  And it is the user's 
obligation to say when that happened, and that it should go now.

Thinking about it again, I'd even go so far as to disallow operation with 
an existing refs/original/.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/6] export get_short_sha1, , (Thu Jul 12, 3:05 pm)
Re: [PATCH 3/6] Define ishex(x) in git-compat-util.h, Johannes Schindelin, (Sat Jul 14, 6:18 am)
[PATCH 6/6] Add git-rewrite-commits, , (Thu Jul 12, 3:06 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Johannes Schindelin, (Sat Jul 14, 8:49 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Sun Jul 15, 10:44 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Johannes Schindelin, (Sun Jul 15, 8:38 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Mon Jul 16, 4:04 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Johannes Schindelin, (Wed Jul 18, 7:17 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Thu Jul 19, 8:40 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Mon Jul 16, 5:47 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Johannes Schindelin, (Wed Jul 18, 7:05 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Mon Jul 16, 6:24 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Johannes Schindelin, (Wed Jul 18, 7:02 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Wed Jul 18, 8:05 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Sat Jul 14, 4:15 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Junio C Hamano, (Sat Jul 14, 3:26 pm)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Sun Jul 15, 10:07 am)
Re: [PATCH 6/6] Add git-rewrite-commits, Sven Verdoolaege, (Fri Jul 13, 4:01 am)
speck-geostationary