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

Re: Can git ignore parts of files

From
Elijah Newren <newren@gmail.com>
Date
Nov 14, 2008, 20:06 UTC
Message-ID
<51419b2c0811141206s2fcedfa4udc609702299cc366@mail.gmail.com>
In-Reply-To
<1226690252.6176.9.camel@rotwang.fnordora.org>
On Fri, Nov 14, 2008 at 12:17 PM, Alan <alan@clueserver.org> wrote:
Show 22 quoted lines
> I have kind of an odd problem that is causing me grief in git.  I figure
> someone has a good solution here.  (Or not, they will soon.)
>
> I have a couple of kernel .config files that are checked into git.  They
> are used to test kernel configurations for the nightly builds where I
> work.
>
> We have a bunch of kernel developers working on drivers.  When they add
> a new driver, they add in the options in the test file to make it
> compile in the test builds.
>
> The problem is that the kernel config file has a timestamp at the top of
> the file that is generated by "make oldconfig" or "make config".  Other
> than removing the timestamp each time manually, is there a way to get
> git to ignore the timestamp on a merge?
>
> What happens is that the authors submit the changes on a branch in most
> cases.  Sometimes they have a version of that file that is quite out of
> date.  When I go to merge, that one file gives me grief 95% of the time.
>
> Is there an easy way around this?  Am I approaching the problem wrong?
> Is there a better way to do this?

Someone wrote a special merge algorithm to handle similar conflicts in tracked ChangeLog files (see http://www.mail-archive.com/bug-gnulib@gnu.org/msg09183.html). Perhaps you could write a similar merge algorithm and use it?

Hope that helps, Elijah

Previous: AlanNext: Daniel Barkalow
Message 4 of 5 in “Can git ignore parts of files”
  1. AlanNov 14, 2008
  2. Francis GaliegueNov 14, 2008
  3. AlanNov 14, 2008
  4. Elijah NewrenNov 14, 2008
  5. Daniel BarkalowNov 16, 2008

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.