git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Using Format/export-subst Howto.

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 17, 2012, 14:21 UTC
Message-ID
<505731CE.1090500@drmicha.warpmail.net>
In-Reply-To
<84EA18831601B6429E578236AE239B01A5498B5390@EAGNMNSXMB07.usa.dce.usps.gov>

Mestnik, Michael J - Eagan, MN - Contractor venit, vidit, dixit 17.09.2012 16:08:

Show 54 quoted lines
> 
>> -----Original Message-----
>> From: Michael J Gruber [mailto:git@drmicha.warpmail.net] 
>> Sent: Monday, September 17, 2012 8:45 AM
>> To: Mestnik, Michael J - Eagan, MN - Contractor
>> Cc: Junio C Hamano; Johannes Sixt; git@vger.kernel.org
>> Subject: Re: Using Format/export-subst Howto.
>>
>> Mestnik, Michael J - Eagan, MN - Contractor venit, vidit, dixit
>> 17.09.2012 14:12:
>>>
>>>> -----Original Message-----
>>>> From: Junio C Hamano [mailto:gitster@pobox.com] 
>>>> Sent: Friday, September 14, 2012 4:24 PM
>>>> To: Michael J Gruber
>>>> Cc: Johannes Sixt; Mestnik, Michael J - Eagan, MN - 
>>>> Contractor; git@vger.kernel.org
>>>> Subject: Re: Using Format/export-subst Howto.
>>>>
>>>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>>>>
>>>>> you need to "rm file && git checkout file"). If the user 
>>>> has to update
>>>>> $Id$ to match the current sha1
>>>>> (by remembering to do a more forceful checkout than 
>>>> checkout -f) then
>>>>> one half of that feature is useless. 
>>>>
>>>> As if there is any value in "$Id$" _feature_.  It's a 
>> checkbox item,
>>>> nothing more ;-).
>>>>
>>>
>>> I agree here, $Id$ is much more useful in rcs/cvs.  That's 
>> why I chose to dive into export-subst, because I wanted my 
>> output to not only contain the uniq Id of the script but also 
>> the time and user of the last edit.
>>>
>>> I'm going to read up on export today.  Just for context I'm 
>> using git to manage daily cron scripts, run on about 1,000 
>> hosts, located on NFS.  I've moved the editing of the scripts 
>> into user's home directories as I'm a fan of not using 
>> editors on live data.  The key point is that when sudoing to 
>> the shared user who manages the files the commands run should 
>> be minimal and "pushd; ln -s ... .git; git pull; rm .git; 
>> popd;" works well.  If I can replace this with something that 
>> would populate these fields that would be awesome.
>>
>> I'm not completely sure about the setup, but something like
>>
>> GIT_DIR=fromthisrepo git archive usethisbranchortag |
>> git tar -xf- -C thereyougo
>>
> Yes, that's about what the man page says.  I though I could pass --keep-newer-files to tar and that would prevent files from being re-created, but a "git archive --format=tar HEAD | tar -tvv" indicates that every file has the current date/time and not, for example, the time of the last commit that modified that file.  Not only would pushing every file be undesirable it would also cause every server to pull every file and that's unacceptable.  Another down side, or perhaps this is the downside, to this method is that it lacks any form of merge capability and will destroy local changes.

I thought it's only a few files and you don't care about merging (in sudo), only about deploying a checkout, since you're removing the git dir.

> It looks like I'll be doing this in a hook.
> 
> BTW: I couldn't find "git tar", if it exists that might be the way for me...  Depending on what it would do.

Oh yeah. Done too much git work lately. I know I keep using "git help foo" rather than "man foo", but this one is new :)

I just meant tar.
Michael
Previous: Mestnik, Michael J - Eagan, MN - ContractorNext: Mestnik, Michael J - Eagan, MN - Contractor
Message 17 of 18 in “Using Format/export-subst Howto.”
  1. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  2. Michael J GruberSep 14, 2012
  3. Johannes SixtSep 14, 2012
  4. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  5. Johannes SixtSep 14, 2012
  6. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  7. Michael J GruberSep 14, 2012
  8. Junio C HamanoSep 14, 2012
  9. Junio C HamanoSep 14, 2012
  10. Michael J GruberSep 17, 2012
  11. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  12. Junio C HamanoSep 17, 2012
  13. Michael J GruberSep 18, 2012
  14. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  15. Michael J GruberSep 17, 2012
  16. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  17. Michael J GruberSep 17, 2012
  18. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.