Re: [git-users] how to diff specifc file for different tags or branch

2012-06-14 Thread Bryce Verdier

On 06/14/2012 09:52 AM, lei yang wrote:

Hi list
As the title,
if I have two branch A and B, how could I diff the file test.c for A and B

Lei


I would do:

git diff A..B path/to/file.c

Bryce

--
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-users@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] how to get the commit id from one file or multi file

2012-06-14 Thread Konstantin Khomoutov
On Thu, 14 Jun 2012 23:53:30 +0800
lei yang  wrote:

> >> Can we get the commit id list for one file or multifile?
> >>
> >> Lei
> >>
> > What do you mean by commit id?
> >
> 
> I mean the file in git tree has lots of commit, I want to get the
> commit list for this file

$ git rev-list --all -- 

or

$ git log --format=%H -- 

Note that Git does not explicitly record file renames (contrary to
certain systems like Subversion, which do), and to compensate for this
when using `git log`, Git has to be told to use special heuristics.
So if you need this, you should probably study the "--find-renames"
command-line option to `git log`, and, possibly, "--find-copies"
and/or "--find-copies-harder" as well.

-- 
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-users@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] how to diff specifc file for different tags or branch

2012-06-14 Thread lei yang
Hi list
As the title,
if I have two branch A and B, how could I diff the file test.c for A and B

Lei

-- 
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-users@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] how to get the formated patches from the merge id

2012-06-14 Thread lei yang
Hello list:

eg:

commit 0e93b4b304ae052ba1bc73f6d34a68556fe93429
Merge: b724cc1 51bfd29

how can I from 0e93b4b304ae052ba1bc73f6d34a68556fe93429 to get the
formated patch ?
(I know we can do git format-patch b724cc1..51bfd29, but how to from
0e93b4b304ae052ba1bc73f6d34a68556fe93429 to get?)

Lei

-- 
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-users@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] how to get the commit id from one file or multi file

2012-06-14 Thread Thomas Ferris Nicolaisen
How about git log file?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/8dbncT-5fYYJ.
To post to this group, send email to git-users@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] how to get the commit id from one file or multi file

2012-06-14 Thread lei yang
On Thu, Jun 14, 2012 at 11:46 PM, Bryce Verdier  wrote:
> On 06/14/2012 08:33 AM, lei yang wrote:
>>
>> Hi List,
>>
>> Can we get the commit id list for one file or multifile?
>>
>> Lei
>>
> What do you mean by commit id?
>

I mean the file in git tree has lots of commit, I want to get the
commit list for this file

Lei



> In trying to save time I'm going to take a guess and then try to answer
> based on that assumption. There is a command called git-blame. You can use
> that to see which person made a change to a particular file.
>
> Hope that helps.
>
> Bryce
>
> --
> 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-users@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-users@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] how to get the commit id from one file or multi file

2012-06-14 Thread Bryce Verdier

On 06/14/2012 08:33 AM, lei yang wrote:

Hi List,

Can we get the commit id list for one file or multifile?

Lei


What do you mean by commit id?

In trying to save time I'm going to take a guess and then try to answer 
based on that assumption. There is a command called git-blame. You can 
use that to see which person made a change to a particular file.


Hope that helps.

Bryce

--
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-users@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] how to get the commit id from one file or multi file

2012-06-14 Thread lei yang
Hi List,

Can we get the commit id list for one file or multifile?

Lei

-- 
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-users@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] GIT with limited CPU time?

2012-06-14 Thread Konstantin Khomoutov
On Thu, 14 Jun 2012 01:41:40 -0700 (PDT)
renne  wrote:

> I'm new to GIT and this group, so a "Hello" to all! :)
> 
> GIT is installed at a Shared Hoster for versioning the Web content. :)
> 
> But the SSH access has a CPU time limit, too, which breaks push and
> pull. :(
> 
> Is there any way GIT can handle incremental push/pulls?
Sure it does: just push less that full history of a branch.

Say, your "master" branch has this history:

...-->A-->B-->C
  ^ "master" ref points here

then you can just push A or master~2 then B or master~1 and so on,
like in

$ git push server master~2:master

Of course, series of commits can be longer, not just one commit, this
is just an example.

Another, completely different approach might be to use git-ftp [1]
for deploying: it's not as efficient that Git, but is able to transfer
only the files changes since the last upload (and also it takes care of
file/directory renaming/removal, when needed).  If your hoster does not
charge for using FTP, this might be a convenient escape route.

1. https://github.com/resmo/git-ftp

-- 
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-users@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] Applying licence (eg. GPL) to Git history

2012-06-14 Thread Chris Jewell
Hi Tassilo,

Thanks *very* much for the information!  That's really very useful to me.

Cheers,

Chris

On 14 Jun 2012, at 12:45, Tassilo Horn wrote:

> Tassilo Horn  writes:
> 
>> Check out http://www.gnu.org/licenses/gpl-howto.html
>> 
>> That says that you should add at least a copyright notice and
>> statement of copying permission.  Fiddeling with the history of each
>> and every source file sounds a bit awkward.  Maybe you could ask the
>> folks at licens...@fsf.org for advice.
> 
> The question was very interesting, so I asked the guys on #gnu.  I was
> told that a lack of license and copyright information basically means:
> you are not allowed to do anything with the code, well, except for
> looking at it if its on some public hosting site.
> 
> So you should be safe to add copyright and licensing information with a
> new commit, and nobody will be legally allowed to build a nuclear rocket
> steering system from some older revision.
> 
> Bye,
> Tassilo
> 
> -- 
> 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-users@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-users@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] Applying licence (eg. GPL) to Git history

2012-06-14 Thread Tassilo Horn
Tassilo Horn  writes:

> Check out http://www.gnu.org/licenses/gpl-howto.html
>
> That says that you should add at least a copyright notice and
> statement of copying permission.  Fiddeling with the history of each
> and every source file sounds a bit awkward.  Maybe you could ask the
> folks at licens...@fsf.org for advice.

The question was very interesting, so I asked the guys on #gnu.  I was
told that a lack of license and copyright information basically means:
you are not allowed to do anything with the code, well, except for
looking at it if its on some public hosting site.

So you should be safe to add copyright and licensing information with a
new commit, and nobody will be legally allowed to build a nuclear rocket
steering system from some older revision.

Bye,
Tassilo

-- 
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-users@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] Applying licence (eg. GPL) to Git history

2012-06-14 Thread Tassilo Horn
chrism0dwk  writes:

Hi Chris,

> I have been working for a couple of years on a scientific project in
> which I have kept my source code (C++) in a private Git repository on
> a private server.  I am now at the stage where I would like to open
> source my code under GPLv3, and place it in a public repository (eg
> GitHub or GoogleCode).  However, because the code has been private up
> to now, I have not bothered with adding the GPL to the source files.
> I'm worried about what this implies for a public repo -- I can add the
> GPL and commit, but this would not stop people from lifting the
> unlicensed code from previous commits.
>
> Is there anyway to fiddle the commits in a Git repository in order to
> add such a licence to the entire history?

Check out http://www.gnu.org/licenses/gpl-howto.html

That says that you should add at least a copyright notice and statement
of copying permission.  Fiddeling with the history of each and every
source file sounds a bit awkward.  Maybe you could ask the folks at
licens...@fsf.org for advice.

Of course, if you don't care about your project's history, you could
just add the headers now and copy all current files to the public
repository instead of pushing everything including the history via git.

Bye,
Tassilo

-- 
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-users@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: Applying licence (eg. GPL) to Git history

2012-06-14 Thread P Rouleau
Hi,

To add the LICENSE file in the root folder, it may be easier to commit the 
file to a new orphan branch (see git checkout --help) or you can checkout 
the first commit (with checkout -b) and amend it to add the LICENSE file. 
You may want to force a specific date to that commit so it appears to 
always been there. Then rebase the master branch on it.

To add the header license to every files, you can use git filter-branch. 
You have to write a rule to detect new files and add the header license. 
filter-branch is a bit hard to grasp, but if the history is long and have 
many files, it will pay off.

P.Rouleau

On Thursday, June 14, 2012 6:14:19 AM UTC-4, chrism0dwk wrote:
>
> Great news, thanks for the advice!
>
> Chris
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/U40FuQkj9bwJ.
To post to this group, send email to git-users@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] how to change the whole git tree to the patchsets

2012-06-14 Thread lei yang
On Thu, Jun 14, 2012 at 1:52 AM, Konstantin Khomoutov
 wrote:
> On Thu, 14 Jun 2012 01:03:27 +0800
> lei yang  wrote:
>
>> I want to change my whole tree to the patchset? which cmd can be
>> used ?
>
> git format-patch --root
>

Thanks
This works well, I know it can extract the file with patchsets with

git format-patch --root xx.c

how could I change the multi-file to pathsets?
eg: xx.c xx.h yy.c

Lei



> Did you RTFM?

-- 
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-users@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: How to rebase from a newer kernel tag ?

2012-06-14 Thread Thomas Ferris Nicolaisen
Sounds pretty straight forward, not accounting for any change conflicts 
that may arise:

cd your-kernel-repo
git remote add kernel-org [location of kernel.org repo]
git fetch kernel-org
git checkout -b rebasing-our-commits-on-top-of-v3034
git rebase kernel-org/[name-of-branch-you-want-from-kernel.org repo]

Now your *rebasing-our-commits-on-top-of-v3034* branch should look like the 
history you want.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/pjsQEDdi7_YJ.
To post to this group, send email to git-users@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: Applying licence (eg. GPL) to Git history

2012-06-14 Thread chrism0dwk
Great news, thanks for the advice!

Chris

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/lf7sV_Hu_dUJ.
To post to this group, send email to git-users@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: Applying licence (eg. GPL) to Git history

2012-06-14 Thread Thomas Ferris Nicolaisen
Hi Chris,

Sure, you can fix older commits. 

The easiest is if you just want to insert a single LICENSE file in the root 
folder of your repository. Simply make a commit where you add this file, 
and then move it towards the beginning of history using interactive 
rebase. 
 

However, if you need to insert a header license in each file (I'm not a 
lawyer, so I don't know if this is necessary, but I've seen a lot of 
projects do this), you need to edit each commit where you added new files. 
You can also do this using interactive rebase, although it will be more 
work (depending on the amount of files, of course).

In order to find with commits you added new files, use git log --name-status, 
and look for entries with the *A prefix -* this means files were added in 
the commit.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/biZrMWM-aDAJ.
To post to this group, send email to git-users@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] Applying licence (eg. GPL) to Git history

2012-06-14 Thread chrism0dwk
Hi all,

I have been working for a couple of years on a scientific project in which 
I have kept my source code (C++) in a private Git repository on a private 
server.  I am now at the stage where I would like to open source my code 
under GPLv3, and place it in a public repository (eg GitHub or GoogleCode). 
 However, because the code has been private up to now, I have not bothered 
with adding the GPL to the source files.  I'm worried about what this 
implies for a public repo -- I can add the GPL and commit, but this would 
not stop people from lifting the unlicensed code from previous commits.

Is there anyway to fiddle the commits in a Git repository in order to add 
such a licence to  the entire history?

Thanks,

Chris

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/lISUiGpOcaQJ.
To post to this group, send email to git-users@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] GIT with limited CPU time?

2012-06-14 Thread renne
Hi,

I'm new to GIT and this group, so a "Hello" to all! :)

GIT is installed at a Shared Hoster for versioning the Web content. :)

But the SSH access has a CPU time limit, too, which breaks push and pull. :(

Is there any way GIT can handle incremental push/pulls?

Thanx for any hint

Renne

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/g3HyuNBmMDQJ.
To post to this group, send email to git-users@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.