Re: Ignore on commit
Marco, > 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. Got it thanks! Would be useful some time indeed. -- Pascal Obry / Magny Les Hameaux (78) The best way to travel is by means of imagination http://v2p.fr.eu.org http://www.obry.net gpg --keyserver keys.gnupg.net --recv-key F949BD3B -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
> From the help page: > > --assume-unchanged, --no-assume-unchanged > ... > > This option can be also used as a coarse file-level mechanism to > ignore uncommitted changes in tracked files (akin to what .gitignore > does for untracked files). > > Seems like it does everything required. I tested and it correctly > hides changes that I want hidden. The only thing I can't see how to do > is get git status to show files with the assume unchanged bit set. I > think there is no way currently, but that might be a nice addition to > make the initial request feature complete. It could show either all > files with the bit set, or files with the bit set that have been > changed (or this could be configurable). This is indeed the solution outlined in [4] on my original post: http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html The presence in git status is quite important or else one has to change the regular workflow with a second status command. Cheers Marco -- So young, and already so unknown -- Pauli blog: http://mcraveiro.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
From: "Andrew Ardill" On 5 October 2012 07:20, Marco Craveiro wrote: ... 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. What is the reason git ignore is no good in this case? Is it simply that you can't see the ignored files in git status, or is it that adding and removing entries to .gitignore is too cumbersome? If it's the latter you could probably put together a simple shell wrapper to automate the task, as otherwise it seems like git ignore does what you need. IIUC the files are already tracked, and a variant of ' git update-index --assume-unchanged' is being requested, so that the command doesn't need to be repeated if they checkuout / swap branches (which assumes I've understood the effect of such an index change correctly) Regards, Andrew Ardill -- -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
On 5 October 2012 12:20, Sitaram Chamarty wrote: > On Fri, Oct 5, 2012 at 7:05 AM, demerphq wrote: >> On 5 October 2012 03:00, Andrew Ardill wrote: >>> On 5 October 2012 07:20, Marco Craveiro wrote: ... 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. >>> >>> What is the reason git ignore is no good in this case? Is it simply >>> that you can't see the ignored files in git status, or is it that >>> adding and removing entries to .gitignore is too cumbersome? If it's >>> the latter you could probably put together a simple shell wrapper to >>> automate the task, as otherwise it seems like git ignore does what you >>> need. >> >> Git ignore doesn't ignore tracked files. > > would 'git update-index --assume-unchanged' work in this case? Didn't > see it mentioned in any of the replies so far (but I have never used > it myself) >From the help page: --assume-unchanged, --no-assume-unchanged ... This option can be also used as a coarse file-level mechanism to ignore uncommitted changes in tracked files (akin to what .gitignore does for untracked files). Seems like it does everything required. I tested and it correctly hides changes that I want hidden. The only thing I can't see how to do is get git status to show files with the assume unchanged bit set. I think there is no way currently, but that might be a nice addition to make the initial request feature complete. It could show either all files with the bit set, or files with the bit set that have been changed (or this could be configurable). Regards, Andrew Ardill -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
Sitaram Chamarty writes: >> Git ignore doesn't ignore tracked files. > > would 'git update-index --assume-unchanged' work in this case? Didn't > see it mentioned in any of the replies so far (but I have never used > it myself) The assume-unchanged bit is *not* an instruction to tell Git to ignore changes. It is your *promise* that you will not change it, and tells Git that it is free to use the contents from the working tree and the contents in the index interchangeably, taking whichever is more convenient for Git to handle. So, no, it might appear to work in some cases, but you are playing with an undefined behaviour. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
On Fri, Oct 5, 2012 at 7:05 AM, demerphq wrote: > On 5 October 2012 03:00, Andrew Ardill wrote: >> On 5 October 2012 07:20, Marco Craveiro wrote: >>> ... >>> 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. >> >> What is the reason git ignore is no good in this case? Is it simply >> that you can't see the ignored files in git status, or is it that >> adding and removing entries to .gitignore is too cumbersome? If it's >> the latter you could probably put together a simple shell wrapper to >> automate the task, as otherwise it seems like git ignore does what you >> need. > > Git ignore doesn't ignore tracked files. would 'git update-index --assume-unchanged' work in this case? Didn't see it mentioned in any of the replies so far (but I have never used it myself) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
On 5 October 2012 03:00, Andrew Ardill wrote: > On 5 October 2012 07:20, Marco Craveiro wrote: >> ... >> 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. > > What is the reason git ignore is no good in this case? Is it simply > that you can't see the ignored files in git status, or is it that > adding and removing entries to .gitignore is too cumbersome? If it's > the latter you could probably put together a simple shell wrapper to > automate the task, as otherwise it seems like git ignore does what you > need. Git ignore doesn't ignore tracked files. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/" -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
On 10/04/2012 05:20 PM, Marco Craveiro wrote: 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 way I usually handle this scenario is by actually making a temporary commit with those temporary changes. And whenever I make a permanent commit, I'll use "rebase -i" to rearrange the commits so that all my permanent commits go before my temporary commits. So when I need to push, I'll just push up till before my temporary commits. This way I also get to make permanent changes in files that I have temporary changes. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
> 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 ..." to unstage) # # modified: some_staged_file.h # # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Ignore on commit
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 -- Pascal Obry / Magny Les Hameaux (78) The best way to travel is by means of imagination http://v2p.fr.eu.org http://www.obry.net gpg --keyserver keys.gnupg.net --recv-key F949BD3B -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html