* Feature idea : notes to track status of a commit, which remotes it is shared to
@ 2013-02-19 9:38 Mildred Ki'Lya
2013-02-19 10:13 ` Thomas Rast
2013-02-19 10:30 ` W. Trevor King
0 siblings, 2 replies; 5+ messages in thread
From: Mildred Ki'Lya @ 2013-02-19 9:38 UTC (permalink / raw)
To: git
Hi,
This is my first time on this list (and by the way, I'm not subscribed,
so please Cc me to the replies). I have an idea that could be useful to
make rewriting history safer and easier to new users (I'm training some
of them). I thought I could share this idea, but perhaps someone already
thought about it. And I'm not providing code.
The idea is to basically track automatically (in notes, either in the
notes namespace or in another namespace) which repository/remote
contains a commit. When doing git log, we'd see lines with each commit,
something like:
commit b044e6d0f1a1782820b052348ab0db314e2db3ca
Author: Myself <myself@localhost.localdomain>
Date: Tue Nov 20 16:46:38 2012 +0100
This is the commit description
Published on:
origin
git@git.host.com:pub/repo.git
Then, we could have all the history rewriting commands (such as rebase
or pull --rebase) die when rewriting commits that are already published
anywhere. We could make an exception for a --force/-f flag or
configuration option, or commits published in another local repository
owned by the same user.
In most setups, it could be useful to tell users they can safely rebase
without worrying about published commits as Git is tracking it for them.
Of course this is not an absolute security, but it's a good start.
What do you think?
Mildred
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Feature idea : notes to track status of a commit, which remotes it is shared to
2013-02-19 9:38 Feature idea : notes to track status of a commit, which remotes it is shared to Mildred Ki'Lya
@ 2013-02-19 10:13 ` Thomas Rast
2013-02-19 10:34 ` W. Trevor King
2013-02-19 18:55 ` Junio C Hamano
2013-02-19 10:30 ` W. Trevor King
1 sibling, 2 replies; 5+ messages in thread
From: Thomas Rast @ 2013-02-19 10:13 UTC (permalink / raw)
To: Mildred Ki'Lya; +Cc: git
Mildred Ki'Lya <mildred-ml@mildred.fr> writes:
> The idea is to basically track automatically (in notes, either in the
> notes namespace or in another namespace) which repository/remote
> contains a commit. When doing git log, we'd see lines with each
> commit, something like:
>
> commit b044e6d0f1a1782820b052348ab0db314e2db3ca
> Author: Myself <myself@localhost.localdomain>
> Date: Tue Nov 20 16:46:38 2012 +0100
>
> This is the commit description
>
> Published on:
> origin
> git@git.host.com:pub/repo.git
The problem here is that doing this in notes is unreliable: you'd have
to identify all places where the set of "publishes" can change for any
commit, and update them there.
It's much easier, if a bit slower, to just run
git branch -r --contains $commit
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Feature idea : notes to track status of a commit, which remotes it is shared to
2013-02-19 10:13 ` Thomas Rast
@ 2013-02-19 10:34 ` W. Trevor King
2013-02-19 18:55 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: W. Trevor King @ 2013-02-19 10:34 UTC (permalink / raw)
To: Thomas Rast, Mildred Ki'Lya; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
On Tue, Feb 19, 2013 at 11:13:19AM +0100, Thomas Rast wrote:
> It's much easier, if a bit slower, to just run
>
> git branch -r --contains $commit
Ah, this would be better than looping in your hook ;).
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Feature idea : notes to track status of a commit, which remotes it is shared to
2013-02-19 10:13 ` Thomas Rast
2013-02-19 10:34 ` W. Trevor King
@ 2013-02-19 18:55 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2013-02-19 18:55 UTC (permalink / raw)
To: Thomas Rast; +Cc: Mildred Ki'Lya, git
Thomas Rast <trast@student.ethz.ch> writes:
> Mildred Ki'Lya <mildred-ml@mildred.fr> writes:
>
>> The idea is to basically track automatically (in notes, either in the
>> notes namespace or in another namespace) which repository/remote
>> contains a commit. When doing git log, we'd see lines with each
>> commit, something like:
>>
>> commit b044e6d0f1a1782820b052348ab0db314e2db3ca
>> Author: Myself <myself@localhost.localdomain>
>> Date: Tue Nov 20 16:46:38 2012 +0100
>>
>> This is the commit description
>>
>> Published on:
>> origin
>> git@git.host.com:pub/repo.git
>
> The problem here is that doing this in notes is unreliable: you'd have
> to identify all places where the set of "publishes" can change for any
> commit, and update them there.
Unreliable you can fix with effort.
But I think a bigger problem is that it is a pointless "false
economy" to attempt to record and try to maintain this note for each
and every commit.
When you push out a tip of the branch to a new location, you would
have to update notes to all commits from that tip down to where in
the history to record that new location? To the root? Also your
upstream may fetch from your published place and you may fetch it
back (you will notice that now the commit appears in your 'origin').
Would you do the traversal and update all notes?
It is both much easier and cheaper to compute this on demand as you
pointed out.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Feature idea : notes to track status of a commit, which remotes it is shared to
2013-02-19 9:38 Feature idea : notes to track status of a commit, which remotes it is shared to Mildred Ki'Lya
2013-02-19 10:13 ` Thomas Rast
@ 2013-02-19 10:30 ` W. Trevor King
1 sibling, 0 replies; 5+ messages in thread
From: W. Trevor King @ 2013-02-19 10:30 UTC (permalink / raw)
To: Mildred Ki'Lya; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
On Tue, Feb 19, 2013 at 10:38:09AM +0100, Mildred Ki'Lya wrote:
> Then, we could have all the history rewriting commands (such as
> rebase or pull --rebase) die when rewriting commits that are already
> published anywhere. We could make an exception for a --force/-f flag
> or configuration option, or commits published in another local
> repository owned by the same user.
You might want to look into extending the sample pre-rebase hook,
which prevents topic branches that are already merged to 'next' branch
from getting rebased. You'd just have to loop over all remote
references instead of only checking the local 'next' branch.
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-19 18:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19 9:38 Feature idea : notes to track status of a commit, which remotes it is shared to Mildred Ki'Lya
2013-02-19 10:13 ` Thomas Rast
2013-02-19 10:34 ` W. Trevor King
2013-02-19 18:55 ` Junio C Hamano
2013-02-19 10:30 ` W. Trevor King
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).