Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
On Wed, 28 Sep 2016, Alex Pilon wrote: > On Wed, Sep 28, 2016 at 04:48:15AM -0400, Robert P. J. Day wrote: > > perfect example: "how do i find the Nth last version of a file?" > > now, you can certainly do this in git, using "git log", then extract > > the commit ID from the appropriate line and so on. but (AFAIK), there > > is no single command to get that info. > > Hehe. > > git rev-list --max-count=1 --skip=2 HEAD -- theFile > > I'm sorry. Couldn't resist. rev-list and rev-parse are your friends > for these kind of more programmatic searches. oh, i know many solutions for that exist, but remember, that's more git "plumbing" than "porcelain". you know what i mean. :-) rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Linux mailing list Linux@lists.oclug.on.ca http://oclug.on.ca/mailman/listinfo/linux
Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
On Wed, Sep 28, 2016 at 04:48:15AM -0400, Robert P. J. Day wrote: > perfect example: "how do i find the Nth last version of a file?" > now, you can certainly do this in git, using "git log", then extract > the commit ID from the appropriate line and so on. but (AFAIK), there > is no single command to get that info. Hehe. git rev-list --max-count=1 --skip=2 HEAD -- theFile I'm sorry. Couldn't resist. rev-list and rev-parse are your friends for these kind of more programmatic searches. ___ Linux mailing list Linux@lists.oclug.on.ca http://oclug.on.ca/mailman/listinfo/linux
Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
> > prepping for delivering upcoming git courses, and i'm adding a short > > page for questions i get on a regular basis along the lines of "how do > > you do X in git?" when, for the most part, i typically answer, "why > > would you want to do that in the first place?" > > Like maybe locking a file on checkout? Git doesn't lock files, mandatory locking may be on its way out from the kernel, and the concept doesn't even apply because it's a DVCS. It sure as heck would never scale. Try that on the kernel! Waay too many contributors. There is no such thing as telling others you have a lock on a file, much less doing so on your own machine. Do your changes, then push, format-patch, etc., and deal with the conflicts, rather than proactively refusing access to everybody else. Also, checking out a file is just that, putting the snapshot of the file from commit X in the working tree (and also staging it). It's nowhere near like in horrors like SharePoint. ___ Linux mailing list Linux@lists.oclug.on.ca http://oclug.on.ca/mailman/listinfo/linux
Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
On 2016-09-28 04:48 AM, Robert P. J. Day wrote: > > prepping for delivering upcoming git courses, and i'm adding a short > page for questions i get on a regular basis along the lines of "how do > you do X in git?" when, for the most part, i typically answer, "why > would you want to do that in the first place?" Like maybe locking a file on checkout? -- Stephen M. Webb___ Linux mailing list Linux@lists.oclug.on.ca http://oclug.on.ca/mailman/listinfo/linux
[OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
prepping for delivering upcoming git courses, and i'm adding a short page for questions i get on a regular basis along the lines of "how do you do X in git?" when, for the most part, i typically answer, "why would you want to do that in the first place?" unsurprisingly, it's fairly common for folks from another VCS to have done some operation regularly over the years, then they're surprised that there's no *simple* way to do that in git, and they get all bent out of shape, even though they can't really defend the need to do such an operation. perfect example: "how do i find the Nth last version of a file?" now, you can certainly do this in git, using "git log", then extract the commit ID from the appropriate line and so on. but (AFAIK), there is no single command to get that info. and, as i said, i'm not sure why people *need* that sort of info. in any event, any thoughts on the sorts of things people do with other VCSes for which there is no immediate git counterpart, but for which there is no comprehensible need to do that in the first place? rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Linux mailing list Linux@lists.oclug.on.ca http://oclug.on.ca/mailman/listinfo/linux