[git-users] Re: Pissed at Git!

2010-06-01 Thread Jeffrey
> I see. Well, it would be nice if it gave a little warning. I think I
> understand why it happened now though. I was tagging some old versions
> that I had failed to do in the past. Not exactly sure how but that
> must have been why.

I believe the warnings about this have been getting more and more user-
friendly - never hurts to have the most recent version of git.  (Quick
grepping of git.git looks like the last significant change was at the
end of January, which was in v1.7.0.)

Jeffrey

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: Pissed at Git!

2010-06-01 Thread Charles Manning
On Wednesday 02 June 2010 10:40:53 Konstantin Khomoutov wrote:

> Also, my idea was this: I found myself in situations like this one
> being discussed, and my first temptation after finding the relevant
> top commit in the reflog always was "tag that immediately, then cool
> down, analyse the situation and think", that is, just give that
> regained precious commit a name so it's now "referenced".

This is always a good policy while you still have training wheels on.

Before you do anything too exciting put some sort of tag in place. Then if you 
get lost it is easier to find where you were before your adventure.

You can do the same for rebasing, merging etc.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Connecting Clones

2010-06-01 Thread ben
Ah, Thank you, thank you!

This bit did the trick:
https://git.wiki.kernel.org/index.php/GitFaq#Why_won.27t_I_see_changes_in_the_remote_repo_after_.22git_push.22.3F

I'm the only dev, so I can make sure the remote has no changes in the
working tree, but I can see now how the post-commit hook would kick it
off just right. Thanks for the pointer in the right direction.

On Jun 1, 2:50 pm, Konstantin Khomoutov  wrote:
> On Jun 1, 9:06 am, ben  wrote:
>
> > I've created a clone (lets call it Dev) of local project (Core), and
> > want to create a remote repo of Dev on a server (Staging) with a
> > working tree (the actual files).
>
> > How do I setup the remotes so that I can push from Dev to Staging?
>
> > Is this the wrong way to do it? Should I also have a bare repo on the
> > server as origin for everything, then just checkout a staging branch
> > when in Staging?
>
> > The catch here is that I've created Core locally, so I can start a new
> > project and have all the benefits of Core, and get updates by pulling
> > when Core itself is updated.
>
> Looks like you should read this 
> thread:http://groups.google.com/group/git-users/browse_thread/thread/d8d73c1...
>
> And this subject has been raised more than once here, so may be a
> little searching through the history could yield more solutions.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Pissed at Git!

2010-06-01 Thread Konstantin Khomoutov
On Jun 2, 1:56 am, Dan Preston  wrote:
> > Yes.
> > Or `git tag recentwork 8658a39`.
> > Or `git checkout master && git merge 8658a39`.
>
> Everything Konstantin said is correct, but I just wanted to add that
> git tag will not get you out of the "detached HEAD" state, so you'll
> probably want to create a branch, or merge the hash into master
> directly, unless the commit really is a special one that you'd like to
> tag for easy reference later.

I mostly wanted to demonstrate that these hash names are no magic. :-)

Also, my idea was this: I found myself in situations like this one
being discussed, and my first temptation after finding the relevant
top commit in the reflog always was "tag that immediately, then cool
down, analyse the situation and think", that is, just give that
regained precious commit a name so it's now "referenced".
Then if it turns out I really want a branch I can create a branch and
get rid of the tag. Or I can just merge the line of development
pointed to by that tag to a branch this history is really belongs to
and get rid of the tag, too.

So it boils down to personal preferences.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: Pissed at Git!

2010-06-01 Thread Dan Preston
> Yes.
> Or `git tag recentwork 8658a39`.
> Or `git checkout master && git merge 8658a39`.

Everything Konstantin said is correct, but I just wanted to add that
git tag will not get you out of the "detached HEAD" state, so you'll
probably want to create a branch, or merge the hash into master
directly, unless the commit really is a special one that you'd like to
tag for easy reference later.

dan

On Tue, Jun 1, 2010 at 2:46 PM, Konstantin Khomoutov
 wrote:
> On Jun 2, 1:07 am, Trans  wrote:
>
>> Sorry, make that:
>>   $ git branch recentwork 8658a39
>
> Yes.
> Or `git tag recentwork 8658a39`.
> Or `git checkout master && git merge 8658a39`.
>
> In this sense, tag and branch names are just alternative means to
> refer to these "true" names of commit objects which are hashes. So you
> can use these hash names in any command expecting a branch or a tag
> name; that's why Git docs name such things with a common name "commit-
> ish".
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/git-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Pissed at Git!

2010-06-01 Thread Konstantin Khomoutov
On Jun 2, 1:45 am, Dan Preston  wrote:

[...]
> Yeah, agreed.  It's not always immediately obvious.  It'll say "Not
> currently on any branch." in the git commit message boilerplate as
> well as git status output though, so I try to keep my eyes peeled for
> that not being the branch I think I'm on.  I like to turn on auto
> coloring in git config and then it colors that red so I notice it.  I
> don't remember the config variable offhand but you should be able to
> look it up on the git config man page.
[...]

I use color.ui = auto

Looks like that's what you're talking about. This setting basically
tries to colorise everything which goes to TTY.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Connecting Clones

2010-06-01 Thread Konstantin Khomoutov
On Jun 1, 9:06 am, ben  wrote:

> I've created a clone (lets call it Dev) of local project (Core), and
> want to create a remote repo of Dev on a server (Staging) with a
> working tree (the actual files).
>
> How do I setup the remotes so that I can push from Dev to Staging?
>
> Is this the wrong way to do it? Should I also have a bare repo on the
> server as origin for everything, then just checkout a staging branch
> when in Staging?
>
> The catch here is that I've created Core locally, so I can start a new
> project and have all the benefits of Core, and get updates by pulling
> when Core itself is updated.

Looks like you should read this thread:
http://groups.google.com/group/git-users/browse_thread/thread/d8d73c1d8b72527b?hl=en

And this subject has been raised more than once here, so may be a
little searching through the history could yield more solutions.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Cron and git archive

2010-06-01 Thread Konstantin Khomoutov
On Jun 1, 8:45 pm, Alexander Zaycev  wrote:

> There is a script to create a backup, with the standard line:
>
> git archive --format=tar --prefix=project/ HEAD | gzip >
> my_git.tar.gz
>
> When run manually it works fine, but cron creates a bad archive (size
> 20 byte).
> In what may be the problem?

The problem may be anywhere including the current phase of the moon
since you specified almost no details about your setup.

Using my rusty telepathic skills, I suspect wrong current directory or
wrong user at the time of the call.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Pissed at Git!

2010-06-01 Thread Konstantin Khomoutov
On Jun 2, 1:07 am, Trans  wrote:

> Sorry, make that:
>   $ git branch recentwork 8658a39

Yes.
Or `git tag recentwork 8658a39`.
Or `git checkout master && git merge 8658a39`.

In this sense, tag and branch names are just alternative means to
refer to these "true" names of commit objects which are hashes. So you
can use these hash names in any command expecting a branch or a tag
name; that's why Git docs name such things with a common name "commit-
ish".

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: Pissed at Git!

2010-06-01 Thread Dan Preston
>  $ git branch recentwork 9c51d95
>
> And I will have a branch at that point?

> Sorry, make that:
>
>  $ git branch recentwork 8658a39

I can honestly never remember what order the branch name and hash go
in so I tend to usually use the more longwinded approach.

$ git checkout 8658a39
$ git checkout -b recentwork

I'm sure it would fail gracefully if you got the order wrong (you
probably have it right, I'm just saying), but I just tend to remember
this way easier.  It is more intuitive to use the branch command to
create a branch I would argue though, so maybe you should not learn
from my example. :-)

> I see. Well, it would be nice if it gave a little warning. I think I
> understand why it happened now though. I was tagging some old versions
> that I had failed to do in the past. Not exactly sure how but that
> must have been why.

Yeah, agreed.  It's not always immediately obvious.  It'll say "Not
currently on any branch." in the git commit message boilerplate as
well as git status output though, so I try to keep my eyes peeled for
that not being the branch I think I'm on.  I like to turn on auto
coloring in git config and then it colors that red so I notice it.  I
don't remember the config variable offhand but you should be able to
look it up on the git config man page.  Not sure why it's not the
default setting.  I suppose people don't like tools messing with their
terminal colors by default?

Also with the shell prompt bit from before, you'll notice that your
branch is a hash instead of an actual branch name.

dan

On Tue, Jun 1, 2010 at 2:05 PM, Trans  wrote:
>
>
> On Jun 1, 4:39 pm, Dan Preston  wrote:
>> You should be ok.  You can use the "git reflog" command to view the
>> history of what you've had checked out.  You can then checkout the
>> hash commit of your latest work again and create a branch from it.  Or
>> alternatively you can merge that hash back to master.
>
> Thank the maker! So the commits are still in there. My reflog reads:
>
> 9c51d95... h...@{0}: checkout: moving from master to master
> 9c51d95... h...@{1}: checkout: moving from html-based to master
> 8f1c474... h...@{2}: checkout: moving from master to html-based
> 9c51d95... h...@{3}: checkout: moving from
> 8658a3910e3ca3b5e66fce6503b42fa431369430 to master
> 8658a39... h...@{4}: commit: added multi-pattern matches and evaluator
> no longer uses traverse
> bb34a07... h...@{5}: commit: admin: add REQUIRE file
> 425d22f... h...@{6}: commit: test: add helpers qed test
> 958447f... h...@{7}: commit: admin: add roadmap and fix version file
> ...
>
> so I can do:
>
>  $ git branch recentwork 9c51d95
>
> And I will have a branch at that point?
>
>> The (no branch) thing happens when you checkout a hash somewhere in
>> your history that isn't associated with any tag or HEAD of a branch.
>> If you then begin committing from there, you end up in the situation
>> you are in now.  It's easy to rectify, but sometimes hard to notice.
>
> I see. Well, it would be nice if it gave a little warning. I think I
> understand why it happened now though. I was tagging some old versions
> that I had failed to do in the past. Not exactly sure how but that
> must have been why.
>
>> I insert this into my bash .profile so that the current branch is
>> displayed in my terminal prompt.  You may find it useful.
>>
>> # Show the git branch in the prompt
>> PS1='[...@\h \W$(__git_ps1 " (%s)")]\$ '
>
> I like it. I will use. Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/git-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Pissed at Git!

2010-06-01 Thread Trans
Sorry, make that:

  $ git branch recentwork 8658a39

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Pissed at Git!

2010-06-01 Thread Trans


On Jun 1, 4:39 pm, Dan Preston  wrote:
> You should be ok.  You can use the "git reflog" command to view the
> history of what you've had checked out.  You can then checkout the
> hash commit of your latest work again and create a branch from it.  Or
> alternatively you can merge that hash back to master.

Thank the maker! So the commits are still in there. My reflog reads:

9c51d95... h...@{0}: checkout: moving from master to master
9c51d95... h...@{1}: checkout: moving from html-based to master
8f1c474... h...@{2}: checkout: moving from master to html-based
9c51d95... h...@{3}: checkout: moving from
8658a3910e3ca3b5e66fce6503b42fa431369430 to master
8658a39... h...@{4}: commit: added multi-pattern matches and evaluator
no longer uses traverse
bb34a07... h...@{5}: commit: admin: add REQUIRE file
425d22f... h...@{6}: commit: test: add helpers qed test
958447f... h...@{7}: commit: admin: add roadmap and fix version file
...

so I can do:

  $ git branch recentwork 9c51d95

And I will have a branch at that point?

> The (no branch) thing happens when you checkout a hash somewhere in
> your history that isn't associated with any tag or HEAD of a branch.
> If you then begin committing from there, you end up in the situation
> you are in now.  It's easy to rectify, but sometimes hard to notice.

I see. Well, it would be nice if it gave a little warning. I think I
understand why it happened now though. I was tagging some old versions
that I had failed to do in the past. Not exactly sure how but that
must have been why.

> I insert this into my bash .profile so that the current branch is
> displayed in my terminal prompt.  You may find it useful.
>
> # Show the git branch in the prompt
> PS1='[...@\h \W$(__git_ps1 " (%s)")]\$ '

I like it. I will use. Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Pissed at Git!

2010-06-01 Thread Dan Preston
You should be ok.  You can use the "git reflog" command to view the
history of what you've had checked out.  You can then checkout the
hash commit of your latest work again and create a branch from it.  Or
alternatively you can merge that hash back to master.

The (no branch) thing happens when you checkout a hash somewhere in
your history that isn't associated with any tag or HEAD of a branch.
If you then begin committing from there, you end up in the situation
you are in now.  It's easy to rectify, but sometimes hard to notice.
I insert this into my bash .profile so that the current branch is
displayed in my terminal prompt.  You may find it useful.

# Show the git branch in the prompt
PS1='[...@\h \W$(__git_ps1 " (%s)")]\$ '

dan

On Tue, Jun 1, 2010 at 1:27 PM, Trans  wrote:
>
> Looks like git just pissed away all my work for the last two months.
>
> I was doing everything like I normally do. I made my changes,
> committed and 'git push origin master'. Everything looked good. Git
> told me "Everything up-to-date". But... I went over to the project's
> github page (http://github.com/proutils/qed) and noticed that nothing
> has been pushed. How is "Everything up-to-date" if none of my changes
> are there?
>
> I was very confused and could only assume something was amiss with
> GitHub. So I put in a ticket. In reply I was asked what branch I was
> on). I'm the lone developer on this so I was on master or so I
> thought. I went to check just in case and discovered I was on
> something called "(no branch)".
>
>  tr...@logisys:qed$ git branch
>  * (no branch)
>    gh-pages
>    html-based
>    master
>
> What the hell is that? Where did it come from? And why?
>
> Now the kicker. I figured "strange, but no big deal" I switched back
> to master and was about to pull in "(no branch)", only to discover
> that "(no-branch)" was GONE! Nata, nothing. Not a word out of git
> about it. It's just not there and all my commits since April 7th have
> vanished.
>
> Someone please tell me there is some hope for getting them back.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/git-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Pissed at Git!

2010-06-01 Thread Trans
Looks like git just pissed away all my work for the last two months.

I was doing everything like I normally do. I made my changes,
committed and 'git push origin master'. Everything looked good. Git
told me "Everything up-to-date". But... I went over to the project's
github page (http://github.com/proutils/qed) and noticed that nothing
has been pushed. How is "Everything up-to-date" if none of my changes
are there?

I was very confused and could only assume something was amiss with
GitHub. So I put in a ticket. In reply I was asked what branch I was
on). I'm the lone developer on this so I was on master or so I
thought. I went to check just in case and discovered I was on
something called "(no branch)".

  tr...@logisys:qed$ git branch
  * (no branch)
gh-pages
html-based
master

What the hell is that? Where did it come from? And why?

Now the kicker. I figured "strange, but no big deal" I switched back
to master and was about to pull in "(no branch)", only to discover
that "(no-branch)" was GONE! Nata, nothing. Not a word out of git
about it. It's just not there and all my commits since April 7th have
vanished.

Someone please tell me there is some hope for getting them back.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Connecting Clones

2010-06-01 Thread ben
Thanks Marek!

That got me setup. I had a few other issues that were preventing me
from pushing (namely, git was not in my $PATH for sshd (the non
interactive shell). I added the path to .bashrc as well
as .bash_profile, and I was able to "git push".

Is there a reason for not making ./public_html/stage the main repo? I
keep seeing folks doing the --bare-init for their repo, then cloning
that and adding post-update or post-commit hooks to update the files.

On May 31, 11:46 pm, Marek Wywiał  wrote:
> On 1 Cze, 07:30, ben  wrote:
>
>
>
> > I need to add that I don't have the git-daemon on the server, it's a
> > shared host.
>
> > On May 31, 10:06 pm, ben  wrote:
>
> > > I've created a clone (lets call it Dev) of local project (Core), and
> > > want to create a remote repo of Dev on a server (Staging) with a
> > > working tree (the actual files).
>
> > > How do I setup the remotes so that I can push from Dev to Staging?
>
> > > Is this the wrong way to do it? Should I also have a bare repo on the
> > > server as origin for everything, then just checkout a staging branch
> > > when in Staging?
>
> > > The catch here is that I've created Core locally, so I can start a new
> > > project and have all the benefits of Core, and get updates by pulling
> > > when Core itself is updated.
>
> on the remote server (prod) create remote repo by:
>   mkdir -p src/myapp.git
>   cd src/myapp.git
>   git --bare init
>
> on your local repo add remote with name 'stage' (you can use any
> name):
>   git remote add stage ssh://u...@host:src/myapp.git
>
> then you push from local to repo to just defined remote repo:
>   git push stage master # or other branch/tag
>
> now on remote server you can checkout from remote repo:
>   git clone src/myapp.git ./public_html
>
> and try some automatic, into src/myapp.git/hooks/post-update put:
>
>   #!/bin/sh
>
>   unset GIT_DIR
>
>   cd ~/public_html
>   git pull
>
> so after 'git push stage sometag.branch' it'll be auto updated at ~/
> public_html
>
> i got this information from:
>  http://www.megiteam.pl/blog/2009/11/1/zeby-bylo-git/- in Polish

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Cron and git archive

2010-06-01 Thread Alexander Zaycev
There is a script to create a backup, with the standard line:

git archive --format=tar --prefix=project/ HEAD | gzip >
my_git.tar.gz

When run manually it works fine, but cron creates a bad archive (size
20 byte).
In what may be the problem?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.