Re: [git-users] Is there a short-hand for referring to the first commit?

2014-09-12 Thread Gergely Polonkai
The only thing I can come up with is this:

$ git rev-list --max-parents=0 HEAD

It can, though, return more than one result if you have multiple
branches from the initial root (e.g. created with git checkout
--orphan). In usual workflows, this should give you a unique ID.

On 12 September 2014 21:35, Sam Roberts  wrote:
> There are shorthands for going back from HEAD, but not for the initial
> commit, AFAICT.
>
> I often want to do this when rebasing, and have come to tagging the
> initial commit in my repos with INITIAL.
>
> Is there a better syntax I'm missing?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Is there a short-hand for referring to the first commit?

2014-09-12 Thread Sam Roberts
There are shorthands for going back from HEAD, but not for the initial
commit, AFAICT.

I often want to do this when rebasing, and have come to tagging the
initial commit in my repos with INITIAL.

Is there a better syntax I'm missing?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-12 Thread Alcolo Alcolo


Le vendredi 12 septembre 2014 14:59:05 UTC+2, Dale Worley a écrit :
>
> > From: Alcolo Alcolo > 
>
> > There is a way to remove all old replaced commits for ever ? 
>
> "git gc --aggressive" works, but you have to purge all the recorded 
> references to old commits.  The ones I know of are: 
>
> You have to set core.logallrefupdates to 'false' to prevent logs from 
> containing references, and gc.pruneexpire to 'now'.  And many scripts 
> that rewrite history leave the old head value in refs/original/..., so 
> you have to do something like: 
>
> git update-ref -d refs/original/refs/heads/$BRANCH 
>
> Dale 
>


I know that ref logs mechanism exits that can retains against git gc.
If my branch can be garbaged in the future, it's good for me, but I think 
not the case:
because I can always run
git replace -d $(git replace -l)
to restore original informations. For this I think, that git keep all 
ancestry of hidden commits.


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-12 Thread Alcolo Alcolo


Le vendredi 12 septembre 2014 14:53:13 UTC+2, Roman Neuhauser a écrit :
>
> # alco...@gmail.com  / 2014-09-12 04:49:43 -0700: 
> > I'm using git replace command to alter ancestry of commits. 
> > I want to delete merged branch then I suppress the branch parent of the 
> > merge commit. 
> > 
> > But, I see that the old reference of replaced commits still exists. 
>
> this reads like you should be using `git rebase` instead. 
>
> -- 
> roman 
>


My git history is complex and it's a nightmare to rebase from old commits.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-12 Thread Dale R. Worley
> From: Alcolo Alcolo 

> There is a way to remove all old replaced commits for ever ?

"git gc --aggressive" works, but you have to purge all the recorded
references to old commits.  The ones I know of are:

You have to set core.logallrefupdates to 'false' to prevent logs from
containing references, and gc.pruneexpire to 'now'.  And many scripts
that rewrite history leave the old head value in refs/original/..., so
you have to do something like:

git update-ref -d refs/original/refs/heads/$BRANCH

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-12 Thread Roman Neuhauser
# alcol...@gmail.com / 2014-09-12 04:49:43 -0700:
> I'm using git replace command to alter ancestry of commits.
> I want to delete merged branch then I suppress the branch parent of the 
> merge commit.
> 
> But, I see that the old reference of replaced commits still exists.

this reads like you should be using `git rebase` instead.

-- 
roman

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] git replace

2014-09-12 Thread Alcolo Alcolo
I'm using git replace command to alter ancestry of commits.
I want to delete merged branch then I suppress the branch parent of the 
merge commit.

But, I see that the old reference of replaced commits still exists.
Then my branch is not deleted but hidden. I would like garbage collect it.

There is a way to remove all old replaced commits for ever ?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.