All of lore.kernel.org
 help / color / mirror / Atom feed
* filter-branch: Remove original/* (was Re: [RFC] What's the best UI  for 'git submodule split'?)
@ 2009-02-14  2:45 Eric Kidd
  2009-02-14 21:25 ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Kidd @ 2009-02-14  2:45 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

On Thu, Feb 12, 2009 at 4:59 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> On Thu, 12 Feb 2009, Eric Kidd wrote:
>
> >   rm .git/refs/original # or just use --force below
>
> BTW I wanted to get rid of this for a long time now, but I cannot seem to
> find the time to work on it.  The 'original' refs should not be needed, as
> that's a job for the reflogs (yeah, people tried to convince me back then,
> but I finally got it, okay?)

Removing the original/* directory would certainly make my life easier.
But the reflog only stores backups for branch heads, not tags, right?
If there's a good way to handle this, I'd be happy to send a patch.

Cheers,
Eric

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

* Re: filter-branch: Remove original/* (was Re: [RFC] What's the best UI  for 'git submodule split'?)
  2009-02-14  2:45 filter-branch: Remove original/* (was Re: [RFC] What's the best UI for 'git submodule split'?) Eric Kidd
@ 2009-02-14 21:25 ` Johannes Schindelin
  2009-02-15 19:33   ` filter-branch: Remove original/* Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-14 21:25 UTC (permalink / raw)
  To: Eric Kidd; +Cc: git

Hi,

On Fri, 13 Feb 2009, Eric Kidd wrote:

> On Thu, Feb 12, 2009 at 4:59 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> >
> > On Thu, 12 Feb 2009, Eric Kidd wrote:
> >
> > >   rm .git/refs/original # or just use --force below
> >
> > BTW I wanted to get rid of this for a long time now, but I cannot seem 
> > to find the time to work on it.  The 'original' refs should not be 
> > needed, as that's a job for the reflogs (yeah, people tried to 
> > convince me back then, but I finally got it, okay?)
> 
> Removing the original/* directory would certainly make my life easier. 
> But the reflog only stores backups for branch heads, not tags, right? If 
> there's a good way to handle this, I'd be happy to send a patch.

Hmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts 
with refs/tags/ (implicitly, not explicitely).

Maybe it is time to change that.

Ciao,
Dscho

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

* Re: filter-branch: Remove original/*
  2009-02-14 21:25 ` Johannes Schindelin
@ 2009-02-15 19:33   ` Junio C Hamano
  2009-02-15 19:47     ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2009-02-15 19:33 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Kidd, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts 
> with refs/tags/ (implicitly, not explicitely).
>
> Maybe it is time to change that.

Why?  Most tags will be created once and will stay there.  That is how tags
are supposed to behave, isn't it?

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

* Re: filter-branch: Remove original/*
  2009-02-15 19:33   ` filter-branch: Remove original/* Junio C Hamano
@ 2009-02-15 19:47     ` Johannes Schindelin
  2009-02-15 21:26       ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-15 19:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Kidd, git

Hi,

On Sun, 15 Feb 2009, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts 
> > with refs/tags/ (implicitly, not explicitely).
> >
> > Maybe it is time to change that.
> 
> Why?  Most tags will be created once and will stay there.  That is how 
> tags are supposed to behave, isn't it?

Exactly my point.  In the common case, it does not change a thing.

However in the case that we _do_ change tags, would you not agree that the 
reflog is _the_ place to record the change?

Ciao,
Dscho

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

* Re: filter-branch: Remove original/*
  2009-02-15 19:47     ` Johannes Schindelin
@ 2009-02-15 21:26       ` Junio C Hamano
  2009-02-15 21:33         ` Johannes Schindelin
  2009-02-16  1:19         ` Sitaram Chamarty
  0 siblings, 2 replies; 12+ messages in thread
From: Junio C Hamano @ 2009-02-15 21:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Kidd, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> Why?  Most tags will be created once and will stay there.  That is how 
>> tags are supposed to behave, isn't it?
>
> Exactly my point.  In the common case, it does not change a thing.

Wrong.

In the common case, you will create tons of useless files that waste a
disk block to store 180-byte or so perr each tag.

> However in the case that we _do_ change tags, would you not agree that the 
> reflog is _the_ place to record the change?

That merely means whoever changes the tag and wants the record of such an
update, which is uncommon, need to make sure reflog is created for that
tag (and that tag only).

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

* Re: filter-branch: Remove original/*
  2009-02-15 21:26       ` Junio C Hamano
@ 2009-02-15 21:33         ` Johannes Schindelin
  2009-02-15 21:51           ` Junio C Hamano
  2009-02-16  1:19         ` Sitaram Chamarty
  1 sibling, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-15 21:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Kidd, git

Hi,

On Sun, 15 Feb 2009, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> >> Why?  Most tags will be created once and will stay there.  That is how 
> >> tags are supposed to behave, isn't it?
> >
> > Exactly my point.  In the common case, it does not change a thing.
> 
> Wrong.
> 
> In the common case, you will create tons of useless files that waste a
> disk block to store 180-byte or so perr each tag.

Hmm.  My reasoning was that the reflogs will be purged by git gc anyway, 
and that it might be interesting to be able to know how a tag entered the 
current repository (if it was not too long ago), but you're probably right 
on that.

> > However in the case that we _do_ change tags, would you not agree that 
> > the reflog is _the_ place to record the change?
> 
> That merely means whoever changes the tag and wants the record of such an
> update, which is uncommon, need to make sure reflog is created for that
> tag (and that tag only).

The thing is: we cannot.  At least not at the moment.

I agree that "git tag" should not add a reflog.  But one should be 
able to force "git update-ref" to create a reflog entry, no?

Ciao,
Dscho

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

* Re: filter-branch: Remove original/*
  2009-02-15 21:33         ` Johannes Schindelin
@ 2009-02-15 21:51           ` Junio C Hamano
  2009-02-15 21:58             ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2009-02-15 21:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Kidd, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> That merely means whoever changes the tag and wants the record of such an
>> update, which is uncommon, need to make sure reflog is created for that
>> tag (and that tag only).
>
> The thing is: we cannot.  At least not at the moment.

$ mkdir -p .git/logs/refs/tags
$ >.git/logs/refs/tags/junker
$ git tag junker
$ wc .git/logs/refs/tags/junker
  1   8 134 .git/logs/refs/tags/junker

Ok, it's not 180 byte as I said, but only 134 bytes.

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

* Re: filter-branch: Remove original/*
  2009-02-15 21:51           ` Junio C Hamano
@ 2009-02-15 21:58             ` Junio C Hamano
  2009-02-16 11:19               ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2009-02-15 21:58 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Kidd, git

Junio C Hamano <gitster@pobox.com> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>>> That merely means whoever changes the tag and wants the record of such an
>>> update, which is uncommon, need to make sure reflog is created for that
>>> tag (and that tag only).
>>
>> The thing is: we cannot.  At least not at the moment.
>
> $ mkdir -p .git/logs/refs/tags
> $ >.git/logs/refs/tags/junker
> $ git tag junker
> $ wc .git/logs/refs/tags/junker
>   1   8 134 .git/logs/refs/tags/junker
>
> Ok, it's not 180 byte as I said, but only 134 bytes.

Having proven my superiour intelligence ;-) I think I can agree if your
next proposal is to toggle reflog on for the tag when "git tag -f" is used
to update an existing tag and core.logAllRefUpdates does not say "never"
(this new value needs to be treated the same as "false" for most other
purposes), and the tag does not already have a reflog.

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

* Re: filter-branch: Remove original/*
  2009-02-15 21:26       ` Junio C Hamano
  2009-02-15 21:33         ` Johannes Schindelin
@ 2009-02-16  1:19         ` Sitaram Chamarty
  1 sibling, 0 replies; 12+ messages in thread
From: Sitaram Chamarty @ 2009-02-16  1:19 UTC (permalink / raw)
  To: git

On 2009-02-15, Junio C Hamano <gitster@pobox.com> wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>>> Why?  Most tags will be created once and will stay there.  That is how 
>>> tags are supposed to behave, isn't it?
>>
>> Exactly my point.  In the common case, it does not change a thing.
>
> Wrong.
>
> In the common case, you will create tons of useless files that waste a
> disk block to store 180-byte or so perr each tag.

Instead of a separate file for each tag, why not something
like logs/TAGS, which just records tag creations.

The downside is it wouldn't represent a *continuous state*
of anything in particular, because you can create tags for
any commit while on any (other) branch.  I'm not smart
enough to figure out the implications of that across the
entire system.

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

* Re: filter-branch: Remove original/*
  2009-02-15 21:58             ` Junio C Hamano
@ 2009-02-16 11:19               ` Johannes Schindelin
  2009-02-16 11:25                 ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-16 11:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Kidd, git

Hi,

On Sun, 15 Feb 2009, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> >>> That merely means whoever changes the tag and wants the record of such an
> >>> update, which is uncommon, need to make sure reflog is created for that
> >>> tag (and that tag only).
> >>
> >> The thing is: we cannot.  At least not at the moment.
> >
> > $ mkdir -p .git/logs/refs/tags
> > $ >.git/logs/refs/tags/junker
> > $ git tag junker
> > $ wc .git/logs/refs/tags/junker
> >   1   8 134 .git/logs/refs/tags/junker
> >
> > Ok, it's not 180 byte as I said, but only 134 bytes.
> 
> Having proven my superiour intelligence ;-) I think I can agree if your
> next proposal is to toggle reflog on for the tag when "git tag -f" is used
> to update an existing tag and core.logAllRefUpdates does not say "never"
> (this new value needs to be treated the same as "false" for most other
> purposes), and the tag does not already have a reflog.

Actually, to prove my inferior intelligence, I suggest going for the easy 
solution: replace the update-ref in filter-branch by a call to git tag -f, 
after making sure that the reflog exists (with >>.git/logs/$tagname).

Eric?

Ciao,
Dscho

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

* Re: filter-branch: Remove original/*
  2009-02-16 11:19               ` Johannes Schindelin
@ 2009-02-16 11:25                 ` Johannes Schindelin
  2009-02-16 11:38                   ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-16 11:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Kidd, git

Hi,

On Mon, 16 Feb 2009, Johannes Schindelin wrote:

> On Sun, 15 Feb 2009, Junio C Hamano wrote:
> 
> > Junio C Hamano <gitster@pobox.com> writes:
> > 
> > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > >
> > >>> That merely means whoever changes the tag and wants the record of such an
> > >>> update, which is uncommon, need to make sure reflog is created for that
> > >>> tag (and that tag only).
> > >>
> > >> The thing is: we cannot.  At least not at the moment.
> > >
> > > $ mkdir -p .git/logs/refs/tags
> > > $ >.git/logs/refs/tags/junker
> > > $ git tag junker
> > > $ wc .git/logs/refs/tags/junker
> > >   1   8 134 .git/logs/refs/tags/junker
> > >
> > > Ok, it's not 180 byte as I said, but only 134 bytes.
> > 
> > Having proven my superiour intelligence ;-) I think I can agree if your
> > next proposal is to toggle reflog on for the tag when "git tag -f" is used
> > to update an existing tag and core.logAllRefUpdates does not say "never"
> > (this new value needs to be treated the same as "false" for most other
> > purposes), and the tag does not already have a reflog.
> 
> Actually, to prove my inferior intelligence, I suggest going for the easy 
> solution: replace the update-ref in filter-branch by a call to git tag -f, 
> after making sure that the reflog exists (with >>.git/logs/$tagname).

Indeed, this proves my inferior intelligence: the update-ref method at 
least kept as much information as possible in the tag, including the 
tagger.

So please strike my suggestion from your memory.

Ciao,
Dscho

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

* Re: filter-branch: Remove original/*
  2009-02-16 11:25                 ` Johannes Schindelin
@ 2009-02-16 11:38                   ` Johannes Schindelin
  0 siblings, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2009-02-16 11:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Kidd, git

Hi,

On Mon, 16 Feb 2009, Johannes Schindelin wrote:

> On Mon, 16 Feb 2009, Johannes Schindelin wrote:
> 
> > On Sun, 15 Feb 2009, Junio C Hamano wrote:
> > 
> > > Junio C Hamano <gitster@pobox.com> writes:
> > > 
> > > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > > >
> > > >>> That merely means whoever changes the tag and wants the record 
> > > >>> of such an update, which is uncommon, need to make sure reflog 
> > > >>> is created for that tag (and that tag only).
> > > >>
> > > >> The thing is: we cannot.  At least not at the moment.
> > > >
> > > > $ mkdir -p .git/logs/refs/tags
> > > > $ >.git/logs/refs/tags/junker
> > > > $ git tag junker
> > > > $ wc .git/logs/refs/tags/junker
> > > >   1   8 134 .git/logs/refs/tags/junker
> > > >
> > > > Ok, it's not 180 byte as I said, but only 134 bytes.
> > > 
> > > Having proven my superiour intelligence ;-) I think I can agree if 
> > > your next proposal is to toggle reflog on for the tag when "git tag 
> > > -f" is used to update an existing tag and core.logAllRefUpdates does 
> > > not say "never" (this new value needs to be treated the same as 
> > > "false" for most other purposes), and the tag does not already have 
> > > a reflog.
> > 
> > Actually, to prove my inferior intelligence, I suggest going for the 
> > easy solution: replace the update-ref in filter-branch by a call to 
> > git tag -f, after making sure that the reflog exists (with 
> > >>.git/logs/$tagname).
> 
> Indeed, this proves my inferior intelligence: the update-ref method at 
> least kept as much information as possible in the tag, including the 
> tagger.

Maybe I can salvage a little bit of the "sapiens" part in the name of the 
species I think I am part of:

-- snip --

 git-filter-branch.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 27b57b8..d828a91 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -459,6 +459,10 @@ if [ "$filter_tag_name" ]; then
 			then
 				warn "gpg signature stripped from tag object $sha1t"
 			fi
+			# make sure the reflogs are written
+			mkdir -p "$(dirname "$GIT_DIR/logs/$new_ref")" &&
+			>> "$GIT_DIR/logs/$new_ref" ||
+			die "Could not initialize reflogs for $new_ref"
 		fi
 
 		git update-ref "refs/tags/$new_ref" "$new_sha1" ||
-- snap --

Eric, this is not even compile tested ;-)  But maybe you can start from 
there?

Ciao,
Dscho

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

end of thread, other threads:[~2009-02-16 11:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-14  2:45 filter-branch: Remove original/* (was Re: [RFC] What's the best UI for 'git submodule split'?) Eric Kidd
2009-02-14 21:25 ` Johannes Schindelin
2009-02-15 19:33   ` filter-branch: Remove original/* Junio C Hamano
2009-02-15 19:47     ` Johannes Schindelin
2009-02-15 21:26       ` Junio C Hamano
2009-02-15 21:33         ` Johannes Schindelin
2009-02-15 21:51           ` Junio C Hamano
2009-02-15 21:58             ` Junio C Hamano
2009-02-16 11:19               ` Johannes Schindelin
2009-02-16 11:25                 ` Johannes Schindelin
2009-02-16 11:38                   ` Johannes Schindelin
2009-02-16  1:19         ` Sitaram Chamarty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.