Re: [git-users] Git tags and information as file header

2018-08-23 Thread Michael Forbes
A general strategy for this type of problem is to add this information to the 
files during the build or deploy phase - i.e. at the point where the file 
leaves the repository to venture out into the wild.

I use, for example "hg log -v -l 1" to replace a tag in my files when I deploy 
something so I can see what version is actually being used.  (I don't know git 
equivalent off the top of my head.)

Does not work if people cherry pick from the repository directly, but then 
perhaps people should not do that...

Michael.

> On Aug 23, 2018, at 9:34 AM, Michael Brininstool  wrote:
> 
> Wow!  How condescending of you!  In my 35 years of programming and system 
> administration, tagging a script or config file with a label that identifies 
> which "version" it is, is essential.  When you deploy these files to 10's of 
> thousand of servers, and problems crop up over the years, being able to see 
> what version of config files the problem machines have helps determine the 
> problem scope.  Hence, I don't use git!
> 
> On Thursday, May 15, 2014 at 3:48:17 PM UTC-6, Magnus Therning wrote:
> On Thu, May 15, 2014 at 01:21:26PM -0700, Alain wrote: 
> > Hi, 
> > 
> > i would like to know if it is possible (and if yes, how to do it) to 
> > retrieve for example tag information or file version from GIT in 
> > order to automatically generate/append a file header to each file in 
> > order to allow traceability. 
> > I mean i would like to have for example: 
> > 
> > /* 
> >  * Filename : filename_from_git_repo 
> >  * version : file_version_from_git_repo 
> >  * author: author_name_from_git_repo 
> >  * date: last_modification_date_from_git_repo 
> >  * ... 
> >  */ 
> > 
> > it would be great for php, css, html or any other file... 
> 
> http://stackoverflow.com/questions/11534655/git-keyword-substitution-like-those-in-subversion
>  
> 
> I personally think that the lack of keyword substitution is a good 
> thing.  I've so far, during my 15 years in software development 
> *never* seen a worthwhile use of VCS keyword substitution. 
> 
> - filname: only useful if I have short memory and am using an editor 
>   that doesn't display the name of the currently open file 
> - version: doesn't make sense in git, would it be the hash?  what does 
>   that tell me? 
> - author: who's the author?  the person that added the file to git? 
>   all people who have made a change to the file?  the person making 
>   the latest change?  who?  and how does that help me as a developer? 
> - date: what use is it to me to know that the file was last changed 2 
>   days ago? 
> 
> All that information is interesting to have, but it's already 
> available in the git repo, why have it in each file too? 
> 
> I'd be very interested in hearing your use case for having that info 
> in the file.  I'd love to be convinced that all those other VCSs 
> haven't wasted effort on implementing a rather useless feature :) 
> 
> /M 
> 
> -- 
> Magnus Therning  OpenPGP: 0xAB4DFBA4 
> email: mag...@therning.org   jabber: mag...@therning.org 
> twitter: magthe   http://therning.org/magnus 
> 
> Heuristic is an algorithm in a clown suit. It’s less predictable, it’s more 
> fun, and it comes without a 30-day, money-back guarantee. 
>  -- Steve McConnell, Code Complete 
> 
> -- 
> 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.


Re: [git-users] Git tags and information as file header

2018-08-23 Thread Konstantin Khomoutov
On Thu, Aug 23, 2018 at 09:34:04AM -0700, Michael Brininstool wrote:

> Wow!  How condescending of you!  In my 35 years of programming and system 
> administration, tagging a script or config file with a label that 
> identifies which "version" it is, is essential.  When you deploy these 
> files to 10's of thousand of servers, and problems crop up over the years, 
> being able to see what version of config files the problem machines have 
> helps determine the problem scope.  Hence, I don't use git!

I don't quite grok your point.
If you want to expand @version@ in your scripts kept in Git,
it's a matter of setting up a pair of scripts calling sed or something
like this.

Keyword expansion
 - Necessarily slows down detection of the fact the checked out copy
   of a file was changed compared to its "priscine" version.
 - Is not flexible enough.

Clear/smudge filters allows you to sidestep both of these problems.

I do understand they create a necessary complexity by requiring to
actually have these filters in the place where a repository is checked
out. But this is solvable as it's possible to keep a tagged file in a Git
repository, which is not part of any commit.

I think it would be better to have some helper to do this stuff as part
of the Git plumbing layer (i.e. in the core) but alas.

[...]

-- 
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 tags and information as file header

2018-08-23 Thread Michael Brininstool
Wow!  How condescending of you!  In my 35 years of programming and system 
administration, tagging a script or config file with a label that 
identifies which "version" it is, is essential.  When you deploy these 
files to 10's of thousand of servers, and problems crop up over the years, 
being able to see what version of config files the problem machines have 
helps determine the problem scope.  Hence, I don't use git!

On Thursday, May 15, 2014 at 3:48:17 PM UTC-6, Magnus Therning wrote:
>
> On Thu, May 15, 2014 at 01:21:26PM -0700, Alain wrote: 
> > Hi, 
> > 
> > i would like to know if it is possible (and if yes, how to do it) to 
> > retrieve for example tag information or file version from GIT in 
> > order to automatically generate/append a file header to each file in 
> > order to allow traceability. 
> > I mean i would like to have for example: 
> > 
> > /* 
> >  * Filename : filename_from_git_repo 
> >  * version : file_version_from_git_repo 
> >  * author: author_name_from_git_repo 
> >  * date: last_modification_date_from_git_repo 
> >  * ... 
> >  */ 
> > 
> > it would be great for php, css, html or any other file... 
>
>
> http://stackoverflow.com/questions/11534655/git-keyword-substitution-like-those-in-subversion
>  
>
> I personally think that the lack of keyword substitution is a good 
> thing.  I've so far, during my 15 years in software development 
> *never* seen a worthwhile use of VCS keyword substitution. 
>
> - filname: only useful if I have short memory and am using an editor 
>   that doesn't display the name of the currently open file 
> - version: doesn't make sense in git, would it be the hash?  what does 
>   that tell me? 
> - author: who's the author?  the person that added the file to git? 
>   all people who have made a change to the file?  the person making 
>   the latest change?  who?  and how does that help me as a developer? 
> - date: what use is it to me to know that the file was last changed 2 
>   days ago? 
>
> All that information is interesting to have, but it's already 
> available in the git repo, why have it in each file too? 
>
> I'd be very interested in hearing your use case for having that info 
> in the file.  I'd love to be convinced that all those other VCSs 
> haven't wasted effort on implementing a rather useless feature :) 
>
> /M 
>
> -- 
> Magnus Therning  OpenPGP: 0xAB4DFBA4 
> email: mag...@therning.orgjabber: mag...@therning.org 
>  
> twitter: magthe   http://therning.org/magnus 
>
> Heuristic is an algorithm in a clown suit. It’s less predictable, it’s 
> more 
> fun, and it comes without a 30-day, money-back guarantee. 
>  -- Steve McConnell, Code Complete 
>

-- 
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 tags and information as file header

2014-05-16 Thread Andy Hardy
On 15/05/2014 23:39, Magnus Therning wrote:
 On Thu, May 15, 2014 at 11:21:25PM +0100, Andy Hardy wrote:
 On 15/05/2014 22:48, Magnus Therning wrote:
 
 - version: doesn't make sense in git, would it be the hash? 
 what does that tell me?
 
 I find an identifier useful when investigating problems and 
 wanting to confirm what files are involved.
 
 What kind of identifier?

Something that I can then use to identify the same file in the
repository and check it's log history, etc.

 What kind of problems and where?

 Is the file in a clone or in a deployment, i.e. you can't rely on a
 VCS to tell you what you have?

It's in the deployment, generally of on-site fixes. Deployment
involves a largeish number of files. Files are not intrinsically
dependent upon one another but may interact.

For a 'release' we'd send the customer a complete set of files, but
often a fix only requires one or two files to be modified which we ask
the customer to install. When a dealing with a later fault, we'd like to
have a method of knowing which files the customer did actually install!

-- 
Andy

-- 
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 tags and information as file header

2014-05-16 Thread Thomas Ferris Nicolaisen
On Friday, May 16, 2014 12:52:44 AM UTC+2, Magnus Therning wrote:

 I must say though that your example might constitute another argument 
 *against* having keywords, that sort of deployment process quickly 
 leads to a mess ;) 


Yeah, the fallacy was that it was easier to deploy one file than to 
deploy the whole new application (an understanding backed by an elaborate 
deployment process involving a lot of manual work). But in the long run it 
was a right mess.

-- 
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 tags and information as file header

2014-05-16 Thread Magnus Therning
On Fri, May 16, 2014 at 8:22 AM, Andy Hardy a...@hardyfamily.org.uk wrote:
 On 15/05/2014 23:39, Magnus Therning wrote:
 On Thu, May 15, 2014 at 11:21:25PM +0100, Andy Hardy wrote:
 On 15/05/2014 22:48, Magnus Therning wrote:

 - version: doesn't make sense in git, would it be the hash?
 what does that tell me?

 I find an identifier useful when investigating problems and
 wanting to confirm what files are involved.

 What kind of identifier?

 Something that I can then use to identify the same file in the
 repository and check it's log history, etc.

 What kind of problems and where?

 Is the file in a clone or in a deployment, i.e. you can't rely on a
 VCS to tell you what you have?

 It's in the deployment, generally of on-site fixes. Deployment
 involves a largeish number of files. Files are not intrinsically
 dependent upon one another but may interact.

 For a 'release' we'd send the customer a complete set of files, but
 often a fix only requires one or two files to be modified which we ask
 the customer to install. When a dealing with a later fault, we'd like to
 have a method of knowing which files the customer did actually install!

So, this is just the same situation as Thomas was talking about.  It
boils down to, only slightly simplified, relying on VCS keyword
substitution in order to avoid having to create proper releases which
can be recorded upon install.  It arguably shouldn't be done in the
first place, but I can see that some situations call for it.  It can
however be done just about as easily in other ways, hash, diff, ...

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

-- 
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 tags and information as file header

2014-05-16 Thread Thomas Ferris Nicolaisen
On Friday, May 16, 2014 8:22:30 AM UTC+2, Andy wrote:

 For a 'release' we'd send the customer a complete set of files, but 
 often a fix only requires one or two files to be modified which we ask 
 the customer to install. When a dealing with a later fault, we'd like to 
 have a method of knowing which files the customer did actually install! 


Why don't you just write a small script that fills in such a header on 
demand? If the header is missing, you can assume that the file is from the 
last proper release.

-- 
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 tags and information as file header

2014-05-16 Thread Alain


On Friday, May 16, 2014 10:45:10 AM UTC+2, Thomas Ferris Nicolaisen wrote:

 On Friday, May 16, 2014 8:22:30 AM UTC+2, Andy wrote:

 For a 'release' we'd send the customer a complete set of files, but 
 often a fix only requires one or two files to be modified which we ask 
 the customer to install. When a dealing with a later fault, we'd like to 
 have a method of knowing which files the customer did actually install! 


 Why don't you just write a small script that fills in such a header on 
 demand? If the header is missing, you can assume that the file is from the 
 last proper release.


i was thinking about support phase. if you sell some web components, during 
support phase your customers could forget what version of your component 
they have installed.
checking some files header could help to know which version of component 
they have installed.

moreover some components could use different plugins that have their own 
version (not necessary the same as the component). but everything is bundle 
together (component, plugins,...) in a zip file.
i was thinking about this typical example in fact.

-- 
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 tags and information as file header

2014-05-15 Thread Magnus Therning
On Thu, May 15, 2014 at 01:21:26PM -0700, Alain wrote:
 Hi,
 
 i would like to know if it is possible (and if yes, how to do it) to
 retrieve for example tag information or file version from GIT in
 order to automatically generate/append a file header to each file in
 order to allow traceability.
 I mean i would like to have for example:
 
 /*
  * Filename : filename_from_git_repo
  * version : file_version_from_git_repo
  * author: author_name_from_git_repo
  * date: last_modification_date_from_git_repo
  * ...
  */
 
 it would be great for php, css, html or any other file...

http://stackoverflow.com/questions/11534655/git-keyword-substitution-like-those-in-subversion

I personally think that the lack of keyword substitution is a good
thing.  I've so far, during my 15 years in software development
*never* seen a worthwhile use of VCS keyword substitution.

- filname: only useful if I have short memory and am using an editor
  that doesn't display the name of the currently open file
- version: doesn't make sense in git, would it be the hash?  what does
  that tell me?
- author: who's the author?  the person that added the file to git?
  all people who have made a change to the file?  the person making
  the latest change?  who?  and how does that help me as a developer?
- date: what use is it to me to know that the file was last changed 2
  days ago?

All that information is interesting to have, but it's already
available in the git repo, why have it in each file too?

I'd be very interested in hearing your use case for having that info
in the file.  I'd love to be convinced that all those other VCSs
haven't wasted effort on implementing a rather useless feature :)

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Heuristic is an algorithm in a clown suit. It’s less predictable, it’s more
fun, and it comes without a 30-day, money-back guarantee.
 -- Steve McConnell, Code Complete 


pgpq8mYolp37J.pgp
Description: PGP signature


Re: [git-users] Git tags and information as file header

2014-05-15 Thread Andy Hardy

On 15/05/2014 22:48, Magnus Therning wrote:


- version: doesn't make sense in git, would it be the hash?  what does
   that tell me?


I find an identifier useful when investigating problems and wanting to 
confirm what files are involved.


--
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 tags and information as file header

2014-05-15 Thread Thomas Ferris Nicolaisen
On Thursday, May 15, 2014 11:48:17 PM UTC+2, Magnus Therning wrote: 


 I'd be very interested in hearing your use case for having that info 
 in the file.  I'd love to be convinced that all those other VCSs 
 haven't wasted effort on implementing a rather useless feature :) 


 This is not my problem, but I'll bite :)

We have a live environment where we very often have to hot deploy single 
files between releases. These small hot-deployments go mostly unmanaged, so 
it's good to have these keywords in the files so we can quickly recognize 
hot-fixes (has this file been patched on this server yet?) .

(based on a true story from SVN times)

-- 
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 tags and information as file header

2014-05-15 Thread Magnus Therning
On Thu, May 15, 2014 at 11:21:25PM +0100, Andy Hardy wrote:
 On 15/05/2014 22:48, Magnus Therning wrote:
 
 - version: doesn't make sense in git, would it be the hash?  what does
that tell me?
 
 I find an identifier useful when investigating problems and wanting
 to confirm what files are involved.

What kind of identifier?
What kind of problems and where?
Is the file in a clone or in a deployment, i.e. you can't rely on a
VCS to tell you what you have?

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

As long as there are ill-defined goals, bizarre bugs, and unrealistic
schedules, there will be Real Programmers willing to jump in and Solve The
Problem, saving the documentation for later.  Long live Fortran!
 -- Ed Post


pgpI5N2cvIGUl.pgp
Description: PGP signature