All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Daniel Nyström" <daniel.nystrom@timeterminal.se>, git@vger.kernel.org
Subject: Re: [Q] Mark files for later commit?
Date: Tue, 29 Mar 2011 09:09:03 +0200	[thread overview]
Message-ID: <4D91858F.7030404@drmicha.warpmail.net> (raw)
In-Reply-To: <7voc4uto9o.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 29.03.2011 08:49:
> Daniel Nyström <daniel.nystrom@timeterminal.se> writes:
> 
>> So this makes me wonder, is there a way to mark certain files for
>> being committed later on? Which does not automatically get added to
>> the staging area (on "git commit -a" or "git add ." and so on) unless
>> it's specifically mentioned by "git add"?
>>
>> We've discussed making it generated automatically, but that's not as
>> easy as it may sound.
>>
>> How would you like a git feature like described above, marking files
>> for later inclusion?
> 
> That does not sound like a feature but merely a source of confusion.
> 
> So far, "commit -a", "add", "add ." etc have _all_ been a way to tell git
> to add the current state of the content to the index.  What is the point
> of making it more complex by letting the user say "I am telling you to add
> everything in the working tree by explicitly saying 'git add .', but I do
> not really mean it"?
> 
> In the meantime, some misguided souls might suggest assume-unchanged, but
> that is not guaranteed to work for this purpose, so ignore them.  This is
> because assume-unchanged is a promise you make git that you will _not_
> change the working tree files, and that promise implies a permission for
> git to use blob object recorded in the index that corresponds to such a
> path instead of reading from the working tree files while doing certain
> operations (such as "git diff") if it is more convenient.
> 

While I've used assume-unchanged before, it really is a great foot-gun
(to shoot yourself into...) to be used only when circumstances force you.

In your case, if you really can't use shortlog or the like, a "light"
way of generating a changelog might be using notes. Attach changelog
notes to each commit (maybe in refs/notes/changelog rather than the
standard). Then, when you need to create the changelog between vX and
vY, you can do

git log --pretty="%N%n" vX..vY

(and go wild on the pretty format, of course). Note that you can share
notes when you set up refspecs etc in a push/pull based workflow. (I'm
not sure how well we support merging/pulling notes refs yet.) This does
not work well in a patch/e-mail-based workflow.

Michael

  reply	other threads:[~2011-03-29  7:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  6:04 [Q] Mark files for later commit? Daniel Nyström
2011-03-29  6:49 ` Junio C Hamano
2011-03-29  7:09   ` Michael J Gruber [this message]
2011-03-29  7:38     ` Johan Herland
2011-03-29  7:45       ` Michael J Gruber
2011-03-29  7:51   ` Junio C Hamano
2011-03-29  9:18     ` Daniel Nyström
2011-03-29 12:01       ` Michael J Gruber
2011-03-29 12:15         ` Daniel Nyström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D91858F.7030404@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=daniel.nystrom@timeterminal.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.