Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Martin Kühne
On Fri, Dec 2, 2016 at 9:53 PM, Bob Uhl  wrote:
> Anyway, consider the patch withdrawn.  If folks are maintaining their
> changes in config.h then it's obviously a terrible idea to obliterate
> it.  I wouldn't submit a patch that I think makes things worse for
> folks.

Because you maybe you even want or need to tweak your own set of
patches, packaging is best done one step away from upstream. Example
[0].

[0] https://github.com/mar77i/dotfiles/tree/master/abs/dwm-git



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Bob Uhl
Laslo Hunhold  writes:
>
>> How come?  At least in my own workflow, I've been surprised by an
>> uncopied config.h repeatedly.  My expectation is that if I change a
>> source file (e.g. config.def.h) that config.h will be updated.
>
> config.def.h contains the default settings. Of course you can change
> the defaults, but from a general perspective, it should remain
> unchanged.

…

> Yes that's exactly the point. If I have a git-repo and a nice,
> fine-tuned config.h and do a git pull that pulls in config.def.h
> changes. When I run make, my config.def is overwritten and lost
> forever. This sucks.

Ah, I guess that's where my workflow has been different: from my POV
customisations to config(.def)?.h are just like personal patches one
makes to the rest of the source code: something I have to manage when I
merge from upstream.  E.g. if I added the clipboard or scrollback
patches locally, then pull down from upstream then there's a chance that
updates will require me to do some maintenance.  In the case of
config(.def)?.h, it's likely that the places where changes occur are
well-enough isolated that merging maintenance is un-needed (git's pretty
good at that).

I'm not asserting that my workflow is superior, just noting why it's
different.  I'm honestly surprised that folks edit config.h, although
reading the st homepage it does appear that's the intended way to do it.
For whatever reason, I hadn't noticed that way back when I first started
using the suckless tools: I've been maintaining my changes in
config.def.h all this time.

I do think the nice thing about the way I've been doing things is that
it's _really_ easy to merge upstream config.def.h changes in (basically
automatic); the negative side of that is that in order to get clean
commits for non-config changes I have to branch off of upstream/master.
Another benefit is that I'm able to maintain a checked-in version of my
changes, rather than keeping them in a non-version-controlled file,
although some might wonder if it's really necessary to track changes to
text colours:-)

Anyway, consider the patch withdrawn.  If folks are maintaining their
changes in config.h then it's obviously a terrible idea to obliterate
it.  I wouldn't submit a patch that I think makes things worse for
folks.

Bob Uhl



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Laslo Hunhold
On Fri, 2 Dec 2016 20:41:51 +0100
Martin Kühne  wrote:

Hey Martin,

> Just keep your config.h and merge changes from config.def.h.
> Why are you destroying a perfect system?

just calm down. I think it was positive we discussed this here. This
way, Bob saw the reasoning behind this design choice and might have
learned a few things from that. After all, he just suggested a patch.

Cheers

Laslo

-- 
Laslo Hunhold 



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Martin Kühne
Just keep your config.h and merge changes from config.def.h.
Why are you destroying a perfect system?

cheers!
mar77i



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Laslo Hunhold
On Fri, 02 Dec 2016 11:58:07 -0700
Bob Uhl  wrote:

Hey Bob,

> How come?  At least in my own workflow, I've been surprised by an
> uncopied config.h repeatedly.  My expectation is that if I change a
> source file (e.g. config.def.h) that config.h will be updated.

config.def.h contains the default settings. Of course you can change
the defaults, but from a general perspective, it should remain
unchanged.

> But I always make my customisation changes to config.def.h and let git
> merge DTRT when upstream changes things.  I can see that if someone
> makes them to config.h and manually copies over new config options
> then he'd be surprised.

Yes that's exactly the point. If I have a git-repo and a nice,
fine-tuned config.h and do a git pull that pulls in config.def.h
changes. When I run make, my config.def is overwritten and lost
forever. This sucks.

> Is this just a case where I'm not understanding how most folks are
> performing their customatisations?

See above.

Cheers

Laslo

-- 
Laslo Hunhold 



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Bob Uhl
ACE  writes:
>
> I would say this patch causes more problems than it solves.

How come?  At least in my own workflow, I've been surprised by an
uncopied config.h repeatedly.  My expectation is that if I change a
source file (e.g. config.def.h) that config.h will be updated.

But I always make my customisation changes to config.def.h and let git
merge DTRT when upstream changes things.  I can see that if someone
makes them to config.h and manually copies over new config options then
he'd be surprised.

Is this just a case where I'm not understanding how most folks are
performing their customatisations?

Bob Uhl



Re: [hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread ACE
Hi Bob.

I would say this patch causes more problems than it solves.



[hackers] [st][PATCH] Make config.h depend on config.def.h

2016-12-02 Thread Bob Uhl
Currently, if one edits config.def.h one must manually delete
config.h (or manually copy the former over the latter); this ensures
that changes force a 'regeneration' (really, a copy).
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6158ab2..152c412 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ options:
@echo "LDFLAGS  = ${LDFLAGS}"
@echo "CC   = ${CC}"

-config.h:
+config.h: config.def.h
cp config.def.h config.h

 .c.o:
--
2.1.4