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

Re: Ignore on commit

From
Marco Craveiro <marco.craveiro@gmail.com>
Date
Oct 4, 2012, 21:20 UTC
Message-ID
<CAKRNd4wbT_boRyFOOL_95FBW4ws8Zzz2ubVCfXuRSevzPdhW9g@mail.gmail.com>
In-Reply-To
<506DEC50.7090402@obry.net>
<ignore on commit>
Show 13 quoted lines
> I'm not sure to follow everything... But looks like:
>
>    $ git add -p
>
> or
>
>    $ git add -i
>
> should do what you want, no?
>
> You select the hunks to commit, let over the "hacks" and then
>
>    $ git commit

Similar but not quite; the idea is that you know that there is some code (I'm just talking about files here, so lets ignore hunks for the moment) which is normally checked in but for a period of time you want it ignored. So you don't want it git ignored but at the same time you don't want to see these files in the list of modified files. The changelist concept allows you to "move" the files out of the way from the main modified section until you are ready to commit them. Perhaps an imaginary git status would help:

# Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: some_staged_file.h # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: some_modified_file.h # # Changes ignored on commit: # # modified: some_other_modified_file.h

Such that if you now did a git add -A, some_modified_file.h would then be staged but some_other_modified_file.h would stay put. Of course the name "ignored on commit" makes little sense in git terms, but I'm using it here as its the svn term. Its a "modified but temporarily ignored" or something.

Cheers
Marco
-- 
So young, and already so unknown -- Pauli

blog: http://mcraveiro.blogspot.com
Previous: Pascal ObryNext: Andrew Wong
Message 3 of 12 in “Ignore on commit”
  1. Marco CraveiroOct 4, 2012
  2. Pascal ObryOct 4, 2012
  3. Marco CraveiroOct 4, 2012
  4. Andrew WongOct 4, 2012
  5. Andrew ArdillOct 5, 2012
  6. demerphqOct 5, 2012
  7. Sitaram ChamartyOct 5, 2012
  8. Junio C HamanoOct 5, 2012
  9. Andrew ArdillOct 5, 2012
  10. Marco CraveiroOct 5, 2012
  11. Philip OakleyOct 5, 2012
  12. Pascal ObryOct 5, 2012

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.