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

How to manage parameter files and code separately using git?

From
TSTilo Schwarz <tilo@tilo-schwarz.de>
Date
May 1, 2010, 12:57 UTC
Message-ID
<op.vb0195s1a8ed4e@dellschleppa>
Hi all,
maybe someone has an idea how to do what I'd like to do using git:

I use git for "normal" c coding, i.e. having branches like master, test, foo, etc. Built are executables (Linux), which need parameter text files to work. What I did up to now was to check in the parameter files in the same way I check in the code: when I change a parameter file, I do a commit on it, this way I always have a history of my parameter files.

This has one drawback: If I check out an older version, I also get the old parameter file, which is not what I want, because the parameters are determined by hardware settings. I.e., I would like to checkout an old commit, but still have the last version of the parameter file.

I tried to solve the problem by
1. creating a branch 'parameters', which contains only the parameter files
2. ignore the parameters files with extension *.m in .gitignore in the  
code branches (master etc.)

This seemed to work at first, but when I switch back from the parameters branch to master, all *.m files are removed, although .gitignore of master contains '*.m'.

So apparently git removes during branch switch first the tracked files and than populates the working dir with the new files of master.

Now my questions are
1. Is there a way to work around it?
2. Is there a maybe totally different way to solve my initial problem  
(separate code history from parameter file history) without using two git  
repos?
Thanks a lot!
     Tilo
Next: Junio C Hamano
Message 1 of 4 in “How to manage parameter files and code separately using git?”
  1. Tilo SchwarzMay 1, 2010
  2. Junio C HamanoMay 1, 2010
  3. Tilo SchwarzMay 2, 2010
  4. Junio C HamanoMay 2, 2010

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.