.gitignore

Discussion around programming R'n'D, its source code and its tools.

Moderators: Zomis, Flumminator

Post Reply
filbo
Posts: 326
Joined: Fri Jun 20, 2014 10:06 am

.gitignore

Post by filbo » Tue Dec 18, 2018 3:04 am

My build directory is littered (by my own actions) with things like rocksndiamonds-sdl2 and rocksndiamonds.old.

git status also whines about various graphics files created by the build.

Code: Select all

$ git diff
diff --git a/.gitignore b/.gitignore
index e884cfc..c521d23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,7 +22,9 @@ src/conf_g2s.c
 src/conf_g2m.c
 src/conf_var.c
 src/conf_act.c
+graphics/gfx_classic/*.png
+graphics/gfx_classic/RocksCE.ilbm
+graphics/gfx_classic/overlay/VirtualButtons.png
 
 # ignore compiled executable files
-rocksndiamonds
-rocksndiamonds.exe
+rocksndiamonds*

HerzAusGold
Posts: 326
Joined: Sun Sep 25, 2005 4:41 pm
Location: Germany

Re: .gitignore

Post by HerzAusGold » Sat Jan 05, 2019 10:26 pm

hi here is my .gitignore
<code>
# ignore temporary development files
*.o
*.a
*.dll
*.png
cpl/
runtime/
.depend

# ignore automatically generated files
src/conftime.h
src/conf_gfx.h
src/conf_snd.h
src/conf_mus.h
src/conf_chr.c
src/conf_chr.h
src/conf_cus.c
src/conf_cus.h
src/conf_grp.c
src/conf_grp.h
src/conf_e2g.c
src/conf_esg.c
src/conf_e2s.c
src/conf_fnt.c
src/conf_g2s.ce
src/conf_g2m.c
src/conf_var.c
src/conf_act.c

# ignore compiled executable files
rocksndiamonds
rocksndiamonds.exe
rocksndiamonds*.exe
rndTest.exe

# ignore transparent files
/src/-transparent

</code>

Holger have changed all C-Comments /* xxxx */ to C++Comments //
even in CONF-Files and even after #define and other preprocessor commands.
Bad to merge, with "Meld" merging is more or less possible.
And the answer is ... 42 !

User avatar
Holger
Site Admin
Posts: 2999
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: .gitignore

Post by Holger » Mon Jan 07, 2019 7:15 pm

My build directory is littered (by my own actions) with things like rocksndiamonds-sdl2 and rocksndiamonds.old.
Mine too! :D

Solution: Put all those files (file patterns) into the file ".git/info/exclude". (On my system, this is a symlink to "../../.gitignore.private", so I have the public and the private Git ignore file nicely next to each others.)
git status also whines about various graphics files created by the build.
Oops, right! I had these patterns in my private Git ignore file -- moved them to the public Git ignore file now!

User avatar
Holger
Site Admin
Posts: 2999
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: .gitignore

Post by Holger » Mon Jan 07, 2019 7:19 pm

Holger have changed all C-Comments /* xxxx */ to C++Comments //
even in CONF-Files and even after #define and other preprocessor commands.
Bad to merge, with "Meld" merging is more or less possible.
Not sure what this has to do with Git ignore files, but: If you simply use "git merge" instead of that other tool you used, it is in fact very easy to merge! I've just merged your changes to a copy of the latest "master" branch, and solving those few conflicts after the automatic merge took me less than five minutes.

"git merge" is really powerful...

filbo
Posts: 326
Joined: Fri Jun 20, 2014 10:06 am

Re: .gitignore

Post by filbo » Tue Jan 08, 2019 1:44 am

You already have 'rocksndiamonds' and 'rocksndiamonds.exe' in .gitignore; it really seems sensible to just change that to 'rocksndiamonds*', anticipating (or in fact reacting to news) that files of that pattern are likely to accumulate there & are ignorable...

Ah, given .gitignore rules, I guess the entry ought to be '/rocksndiamonds*' (ignore them only in the root of the repository).

Post Reply