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

Re: Hey - A Conceptual Simplication....

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 18, 2009, 19:40 UTC
Message-ID
<m37htnd3kb.fsf@localhost.localdomain>
In-Reply-To
<008401ca6880$33d7e550$9b87aff0$@com>
"George Dennie" <gdennie@pospeople.com> writes:
> Thanks Jan, Jason, Jonathan, and Thomas for your response, your thoughts and
> concerns are enlightening....
Show 10 quoted lines
> Jason Sewell wrote...
>
> > If you have a bunch of debugging code sitting around in your working tree
> > after you've tracked down a problem, you don't want to commit all
> > of those printfs, etc. - you want to commit the fix. This has
> > ramifications from making diffs of history cleaner to making git
> > bisect actually useful.
> 
> One of the concerns I have with the manual pick-n-commit is that you can
> forget a file or two.
I don't think that this concern is valid.  

The files which make project are those defined in Makefile or equivalent project file, _not_ all files (or even all files of specific type / extension) that do happen to reside in given directory. And those files whould be known to git, either added when importing project into git, or added when they were created. And if they are known it is enough to use "git commit -a" to pick all changes.

So I don't see how you can 'forget a file or two'.

Are those *theoretical* concerns, or is it something that happened to you doring using git?

Show 5 quoted lines
> Consequently, unless you do a clean checkout and test
> of the commit, you don't know that your publishable version even compiles.
> It seems safer to commit the entirety of your work in its working state and
> then do a clean checkout from a dedicated publishable branch and manually
> merge the changes in that, test, and commit.
That's what
  git stash --keep-index
is for.  
That, and continuous integration repository, with it's hooks.
> 
> It seems the intuitive model is to treat version control as applying to the
> whole document, not parts of it. In this respect the document is defined by
> the IDE, namely the entire solution, warts and all.

Yes, and IDE has project file which defines which files are in project, just like version control system has it's tracked files.

Show 5 quoted lines
> When you start
> selectively saving parts of the document then you are doing two things,
> versioning and publishing; and at the same time. This was a critical flaw in
> older version control approaches because the software solution document is a
> file system sub-tree.

Atomic commits are important, but the distinction between tracked files, (untracked) ignored files, and files in "limbo" state (neither tracked nor ignored) is orthogonal to having atomic commits.

Show 13 quoted lines
> Jason Sewell wrote...
>
> >  Isn't fastidiously maintaining a .gitignore file to contain
> > everything you *don't* want in the project more confusing than
> > explicitly specifying things you *do* want in the project?  
> 
> This is git ignore for "cleaning prior to a check" and git ignore for
> "adding to index" and is not an either or. You would specify what you don't
> want to version tracked as normal but you can also stipulate what you don't
> want to be deleted during a clean restore (which should otherwise completely
> wipe the folder prior to restoring a specific commit). This would permit
> embedding non-version elements within the version tree for whatever reason
> you find necessary.
And this is supposedly easier to use?  I don't think so.
Show 10 quoted lines
> Thomas Rast wrote...
>
> > That would require supernaturally good maintenance of your
> > .gitignore to avoid adding or (worse) nuking files by accident.
> 
> On the contrary, the approach would all but eliminate the possibility of
> loss of data since you would not manually (and therefore error prone-ingly)
> pruning until after a commit. In fact, one might default automatic commits
> (if required) prior to checkouts or at least an alert system when
> uncommitted changes exists.
What?  I cannot understand you here.

I think that automatic pruning of non-versioned files is _more_ error prone than manual deleting of files. And much more error prone that just keeping non-ignored and non-tracked files.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: George DennieNext: Jason Sewall
Message 5 of 25 in “Hey - A Conceptual Simplication....”
  1. George DennieNov 18, 2009
  2. Jonathan del StrotherNov 18, 2009
  3. Jan KrügerNov 18, 2009
  4. George DennieNov 18, 2009
  5. Jakub NarebskiNov 18, 2009
  6. Jason SewallNov 18, 2009
  7. George DennieNov 19, 2009
  8. Björn SteinbrinkNov 19, 2009
  9. George DennieNov 19, 2009
  10. Junio C HamanoNov 19, 2009
  11. Jakub NarebskiNov 20, 2009
  12. Junio C HamanoNov 20, 2009
  13. Dmitry PotapovNov 20, 2009
  14. Jakub NarebskiNov 19, 2009
  15. Dmitry PotapovNov 20, 2009
  16. david@lang.hmNov 20, 2009
  17. Dmitry PotapovNov 20, 2009
  18. Björn SteinbrinkNov 20, 2009
  19. Dmitry PotapovNov 20, 2009
  20. Dmitry PotapovNov 20, 2009
  21. Junio C HamanoNov 20, 2009
  22. Dmitry PotapovNov 20, 2009
  23. Thomas RastNov 18, 2009
  24. Jason SewallNov 18, 2009
  25. Linus TorvaldsNov 18, 2009

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.