* [PATCH] git init: activate rerere by default
@ 2007-07-05 12:16 Johannes Schindelin
2007-07-05 13:10 ` Alex Riesen
0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-05 12:16 UTC (permalink / raw)
To: git, gitster
We have a working implementation of rerere since long ago, and we even
make sure that it works as expected in a test case. It is also a very
useful feature, so why not turn it on for the benefit of users who are
not even aware of it? This patch does that.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Maybe it is too late for 1.5.3? But maybe this is nice enough to
have in 1.5.3?
BTW I shamelessly put in a comment to boost my comment ration on
ohloh.net...
builtin-init-db.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 66ddaeb..aa3a01e 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -293,6 +293,9 @@ static int create_default_files(const char *git_dir, const char *git_work_tree,
if (git_work_tree)
git_config_set("core.worktree", git_work_tree);
}
+ /* activate rerere */
+ strcpy(path + len, "rr-cache");
+ safe_create_dir(path, 1);
return reinit;
}
--
1.5.3.rc0.2689.g99ca2-dirty
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 12:16 Johannes Schindelin
@ 2007-07-05 13:10 ` Alex Riesen
2007-07-05 16:46 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2007-07-05 13:10 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, gitster
On 7/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> We have a working implementation of rerere since long ago, and we even
> make sure that it works as expected in a test case. It is also a very
> useful feature, so why not turn it on for the benefit of users who are
> not even aware of it? This patch does that.
Maybe just create in template directory?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 13:10 ` Alex Riesen
@ 2007-07-05 16:46 ` Junio C Hamano
2007-07-05 17:15 ` Johannes Schindelin
0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2007-07-05 16:46 UTC (permalink / raw)
To: Alex Riesen; +Cc: Johannes Schindelin, git, gitster
"Alex Riesen" <raa.lkml@gmail.com> writes:
> On 7/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>>
>> We have a working implementation of rerere since long ago, and we even
>> make sure that it works as expected in a test case. It is also a very
>> useful feature, so why not turn it on for the benefit of users who are
>> not even aware of it? This patch does that.
>
> Maybe just create in template directory?
Sounds saner.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 16:46 ` Junio C Hamano
@ 2007-07-05 17:15 ` Johannes Schindelin
2007-07-05 18:53 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-05 17:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alex Riesen, git
Hi,
On Thu, 5 Jul 2007, Junio C Hamano wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > On 7/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >>
> >> We have a working implementation of rerere since long ago, and we even
> >> make sure that it works as expected in a test case. It is also a very
> >> useful feature, so why not turn it on for the benefit of users who are
> >> not even aware of it? This patch does that.
> >
> > Maybe just create in template directory?
>
> Sounds saner.
Does it?
I had the impression that the templates are meant for site-specific
modifications. My patch tried to make it more standard than that.
For example, you _could_ have set core.logallrefupdates from the
templates, yet you chose not to, but rather hard-wire it into "git init".
Which I completely agree to.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 17:15 ` Johannes Schindelin
@ 2007-07-05 18:53 ` Junio C Hamano
2007-07-05 19:22 ` Johannes Schindelin
0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2007-07-05 18:53 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Alex Riesen, git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Hi,
>
> On Thu, 5 Jul 2007, Junio C Hamano wrote:
>
>> "Alex Riesen" <raa.lkml@gmail.com> writes:
>>
>> > On 7/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> >>
>> >> We have a working implementation of rerere since long ago, and we even
>> >> make sure that it works as expected in a test case. It is also a very
>> >> useful feature, so why not turn it on for the benefit of users who are
>> >> not even aware of it? This patch does that.
>> >
>> > Maybe just create in template directory?
>>
>> Sounds saner.
>
> Does it?
>
> I had the impression that the templates are meant for site-specific
> modifications. My patch tried to make it more standard than that.
>
> For example, you _could_ have set core.logallrefupdates from the
> templates, yet you chose not to, but rather hard-wire it into "git init".
> Which I completely agree to.
I think what Alex meant is this.
diff --git a/templates/rr-cache-- b/templates/rr-cache--
new file mode 100644
index 0000000..fae8870
--- /dev/null
+++ b/templates/rr-cache--
@@ -0,0 +1 @@
+: this is just to ensure the directory exists.
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 18:53 ` Junio C Hamano
@ 2007-07-05 19:22 ` Johannes Schindelin
2007-07-05 21:40 ` Alex Riesen
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-05 19:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alex Riesen, git
Hi,
On Thu, 5 Jul 2007, Junio C Hamano wrote:
> I think what Alex meant is this.
>
> diff --git a/templates/rr-cache-- b/templates/rr-cache--
> new file mode 100644
> index 0000000..fae8870
> --- /dev/null
> +++ b/templates/rr-cache--
> @@ -0,0 +1 @@
> +: this is just to ensure the directory exists.
>
Yes, I fully understood.
However, when I use a new version of Git (which happens regularly, since I
pull quite often), I do not update the templates. I guess that many
distros do not update their templates as often as the core, because they
are much more likely to be modified distro-specifically. Further, there
are some platforms which are insane enough that you cannot trust the
executable bit, and therefore the templates are disabled by default.
All this means that the given patch would not hardly make rerere as
widespread as I intended.
Yes, templates are nice. But I don't think that templates are the way to
go for introducing nice features as rr-cache.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 19:22 ` Johannes Schindelin
@ 2007-07-05 21:40 ` Alex Riesen
2007-07-05 22:29 ` Johannes Schindelin
2007-07-06 5:12 ` Junio C Hamano
2007-07-06 11:12 ` しらいしななこ
2 siblings, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2007-07-05 21:40 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
Johannes Schindelin, Thu, Jul 05, 2007 21:22:43 +0200:
> Yes, templates are nice. But I don't think that templates are the way to
> go for introducing nice features as rr-cache.
Looks like you're trying to enforce the feature, not introduce.
It changes the user-visible behaviour, and this can be unexpected.
It is not like you see people asking question: "How do I avoid
repeating the same boring conflict?" every day on vger or irc.
That said, the templates are installed with every make install (and I
suppose with every .deb and .rpm), and template is copied in every new
repo, so people will get the rr-cache sooner or later. What's wrong
with "a bit later" than "much sooner"?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 21:40 ` Alex Riesen
@ 2007-07-05 22:29 ` Johannes Schindelin
0 siblings, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-05 22:29 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, git
Hi,
On Thu, 5 Jul 2007, Alex Riesen wrote:
> Johannes Schindelin, Thu, Jul 05, 2007 21:22:43 +0200:
> > Yes, templates are nice. But I don't think that templates are the way to
> > go for introducing nice features as rr-cache.
>
> Looks like you're trying to enforce the feature, not introduce.
Yes. Actually, since long I wondered if this feature should not be
controlled by a core.rerere variable.
> It changes the user-visible behaviour, and this can be unexpected.
Yes, but I think for the better.
> It is not like you see people asking question: "How do I avoid repeating
> the same boring conflict?" every day on vger or irc.
That is because people have been trained to cope with CVS. They do not
even know rerere exists.
> That said, the templates are installed with every make install (and I
> suppose with every .deb and .rpm), and template is copied in every new
> repo, so people will get the rr-cache sooner or later. What's wrong with
> "a bit later" than "much sooner"?
In the part of my reply that you conveniently scissored, I explained that
it is often not "a bit later", but "never".
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 19:22 ` Johannes Schindelin
2007-07-05 21:40 ` Alex Riesen
@ 2007-07-06 5:12 ` Junio C Hamano
2007-07-06 12:03 ` Johannes Schindelin
2007-07-06 11:12 ` しらいしななこ
2 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2007-07-06 5:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Alex Riesen, git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> .... I guess that many
> distros do not update their templates as often as the core, because they
> are much more likely to be modified distro-specifically.
Can you back that up? Fedora and Debian seem to ship them unmodified.
> Further, there
> are some platforms which are insane enough that you cannot trust the
> executable bit, and therefore the templates are disabled by default.
>
> All this means that the given patch would not hardly make rerere as
> widespread as I intended.
If you truly want to have rerere enabled by default, it might
make sense to:
* Remove "if test -d "$GIT_DIR/rr-cache" tests we have in the
existing users;
* Implement a new test in builtin-rerere.c, as:
- if rerere.enabled configuration does not exist, check
$GIT_DIR/rr-cache as before;
- if rerere.enabled configuration is true, do not bother
checking $GIT_DIR/rr-cache, but just do it;
- if rerere.enabled configuration is explicitly set to false,
never use rerere.
* Maybe later we might change the default value for
rerere.enabled to "true", IOW, everybody except people who
say "[rerere] enabled = false" in their configuration
automatically gets rerere.
Doing it in git-init, either your patch or by installing a new
template, means existing old repository would never get the
updated behaviour unless the user runs "git init" there, which
is not a very intuitive thing to do to begin with.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-05 19:22 ` Johannes Schindelin
2007-07-05 21:40 ` Alex Riesen
2007-07-06 5:12 ` Junio C Hamano
@ 2007-07-06 11:12 ` しらいしななこ
2 siblings, 0 replies; 12+ messages in thread
From: しらいしななこ @ 2007-07-06 11:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Alex Riesen, git
Quoting Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> All this means that the given patch would not hardly make rerere as
> widespread as I intended.
>
> Yes, templates are nice. But I don't think that templates are the way to
> go for introducing nice features as rr-cache.
I am sorry, but I can't understand how it works and how it is useful,
after reading the manual page of git-rerere three times. Are there
"rerere tutorial for stupid newbies" document somewhere? I earlier
created .git/rr-cache folder but I have not seen anything interesting
happened in my repository.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
----------------------------------------------------------------------
Free pop3 email with a spam filter.
http://www.bluebottle.com/tag/5
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
[not found] <200707061112.l66BCb6w017186@mi1.bluebottle.com>
@ 2007-07-06 12:03 ` Johannes Schindelin
0 siblings, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-06 12:03 UTC (permalink / raw)
To: しらいしななこ; +Cc: Alex Riesen, git
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1195 bytes --]
Hi,
On Fri, 6 Jul 2007, しらいしななこ wrote:
> I am sorry, but I can't understand how [git rerere] works and how it is
> useful, after reading the manual page of git-rerere three times. Are
> there "rerere tutorial for stupid newbies" document somewhere? I
> earlier created .git/rr-cache folder but I have not seen anything
> interesting happened in my repository.
There is no tutorial. In fact, it should help your workflow seemlessly.
Suppose that you rebase a lot, on top of an upstream who has conflicting
changes, and refuses (at least for a long time) to merge your work.
What you usually do is work out the conflicts over and over again, often
identically. Basically for many conflicts (but not necessarily all!), you
say: "Yes, I have seen that. My version is better."
When rerere is enabled, it records the conflicting hunks (i.e. the parts
between <<<<<<< ... ======= ... >>>>>>>) together with how you resolved
it, and next time it sees the same conflicting hunks, it automatically
applies your resolution.
You should still inspect if it makes sense, and therefore the merge will
still fail, even if all conflicts were automatically resolved.
Hth,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git init: activate rerere by default
2007-07-06 5:12 ` Junio C Hamano
@ 2007-07-06 12:03 ` Johannes Schindelin
0 siblings, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2007-07-06 12:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alex Riesen, git
Hi,
On Thu, 5 Jul 2007, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > .... I guess that many distros do not update their templates as often
> > as the core, because they are much more likely to be modified
> > distro-specifically.
>
> Can you back that up? Fedora and Debian seem to ship them unmodified.
No.
> > Further, there are some platforms which are insane enough that you
> > cannot trust the executable bit, and therefore the templates are
> > disabled by default.
But this still holds.
> If you truly want to have rerere enabled by default, it might make sense
> to:
>
> * Remove "if test -d "$GIT_DIR/rr-cache" tests we have in the
> existing users;
>
> * Implement a new test in builtin-rerere.c, as:
>
> - if rerere.enabled configuration does not exist, check
> $GIT_DIR/rr-cache as before;
>
> - if rerere.enabled configuration is true, do not bother
> checking $GIT_DIR/rr-cache, but just do it;
>
> - if rerere.enabled configuration is explicitly set to false,
> never use rerere.
>
> * Maybe later we might change the default value for
> rerere.enabled to "true", IOW, everybody except people who
> say "[rerere] enabled = false" in their configuration
> automatically gets rerere.
>
> Doing it in git-init, either your patch or by installing a new
> template, means existing old repository would never get the
> updated behaviour unless the user runs "git init" there, which
> is not a very intuitive thing to do to begin with.
Well, I finally bit the apple. Will post in a minute.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-07-06 12:10 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200707061112.l66BCb6w017186@mi1.bluebottle.com>
2007-07-06 12:03 ` [PATCH] git init: activate rerere by default Johannes Schindelin
2007-07-05 12:16 Johannes Schindelin
2007-07-05 13:10 ` Alex Riesen
2007-07-05 16:46 ` Junio C Hamano
2007-07-05 17:15 ` Johannes Schindelin
2007-07-05 18:53 ` Junio C Hamano
2007-07-05 19:22 ` Johannes Schindelin
2007-07-05 21:40 ` Alex Riesen
2007-07-05 22:29 ` Johannes Schindelin
2007-07-06 5:12 ` Junio C Hamano
2007-07-06 12:03 ` Johannes Schindelin
2007-07-06 11:12 ` しらいしななこ
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).