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

Re: .gitignore for large files?

From
Philip Oakley <philipoakley@iee.org>
Date
Jul 25, 2011, 06:53 UTC
Message-ID
<179943CA8CCC4BEE811E31B2BCC634D1@PhilipOakley>
In-Reply-To
<CACsJy8C=ks1_TdQdNi4Wq8OCSAON9rhJ88zAp1kDZy3fBg2pmQ@mail.gmail.com>
Duy,

The .git attributes is a good call. I'm thinking that it would be a global flag (i.e. is a max file limit in place at all on this repo), and then a set of limits, initially one for 'text' and one for 'binary' (and possibly a third for anything with an ext diff), and probably use a similar attribute format as used for setting diff attributes and its filters to set a per file type limit [if required]

The relevant function names gives me a place to start....
Philip
----- Original Message ----- 
From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: "Philip Oakley" <philipoakley@iee.org>
Cc: "Git List" <git@vger.kernel.org>
Sent: Sunday, July 24, 2011 3:59 AM
Subject: Re: .gitignore for large files?
Show 37 quoted lines
> On Sun, Jul 24, 2011 at 3:00 AM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>> Has there been any discussion in the past on a method for ignoring large
>> files via the .gitignore process?
>>
>> It does appear to be a moderately common problem for folk to accidentally
>> commit a large file which bloats their repository and they want rid of 
>> it,
>> which causes history re-writes and such palaver.
>
> Once they are in, they cannot be ignored. Perhaps commit hooks at
> server side is a better place?
>
>> Perhaps a simple '>' and '<' option (the latter to cover null or minimal
>> files?) with a --warn postfix may be possible. Just an initial thought.
>
> Or you can make use of .gitattributes, more flexible syntax.
>
>> Where would the 'right place' be for me to look at the git code if it was
>> beneficial.
>
> In dir.c, add_exlude() does the parsing, excluded_from_list() handles the 
> logic.
> -- 
> Duy
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1390 / Virus Database: 1518/3783 - Release Date: 07/23/11
> 
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 3 of 6 in “.gitignore for large files?”
  1. Philip OakleyJul 23, 2011
  2. Nguyen Thai Ngoc DuyJul 24, 2011
  3. Philip OakleyJul 25, 2011
  4. Nguyen Thai Ngoc DuyJul 25, 2011
  5. Junio C HamanoJul 25, 2011
  6. Philip OakleyJul 25, 2011

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.