git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: James Nylen <jnylen@gmail.com>
To: Jim Vahl <jv@wmdb.com>
Cc: git@vger.kernel.org, skotd122@gmail.com
Subject: Re: A basic question
Date: Thu, 11 Oct 2012 14:40:44 -0400	[thread overview]
Message-ID: <507712AC.7090801@gmail.com> (raw)
In-Reply-To: <002801cda7d7$4792c260$d6b84720$@com>


On 10/11/2012 1:38 PM, Jim Vahl wrote:
> For the sake of argument, I'll assume that a committing a change implies
> that the file has passed the testing process.  So my questions are:
You should not assume this.  You / your developers should commit far 
more frequently than you test and release versions.  For example, I 
usually try to commit after a day's work at most.

Instead, you should mark a tested version using tags (the git tag 
command). Here is a workflow that seems like it would work well for you:

1. Commit 1
2. Commit 2
3. Commit 3 - TAGGED as release-v0.1
4. Commit 4
5. Commit 5 - TAGGED as release-v0.2
6. Commit 6
7. Commit 7

In this scenario, you reviewed the code after Commit 3 was entered and 
it passed your tests.  You then tagged this version of the code as 
version 0.1.  Tagging is just a convenient way to associate a name (for 
example, "release-v0.1") with the code tree as of a certain commit.  
Similarly with Commit 5 and version 0.2.

Commits 6 and 7 represent changes made to the code for features that are 
in progress, bug fixes, etc.  They have not been reviewed yet.  For the 
purpose of releasing versions, you don't care about these commits.

For the purpose of releasing versions, you also don't care about the 
state of files in the git repository (whether they are modified, or some 
or all changes are staged).  These features exist to help you prepare 
commits and understand what changes you are committing, not as a way of 
managing versions of the software.

Many people use git in more complex ways that involve non-linear 
development histories (branches).  For example, you can have multiple 
developers working on different features simultaneously, each committing 
their own changes, and you can use git to help you reconcile the changes 
later.  You can also have a "release" branch which stores only the 
released versions, and separate "development" branches where code 
changes occur.  These workflows are harder to wrap your head around, though.

> 1) Does git have a built-in way to get a list of all of the "most recently
> committed" files only at a given point in time, thus automatically recording
> the revisions of all of the component files of a release?   This implies
> that for files which are being modified or which have been staged but not
> committed, that git would go back to find the "predecessor" file which had
> been committed.
Let's replace "committed" with "tagged as a released version". Then 
yes.  The person who wants to release a version would do:

git checkout release-v0.1

At this point their working folder will contain all of the files for the 
v0.1 release.  You can run tests, run the build process and generate 
executables, or whatever other kind of deployment process needs to be done.

Another option is to create a zip file containing all the code as of 
version 0.1:

git archive release-v0.1 -o release-v0.1.zip

>   2) Does git have a way of creating and exporting a list of the "most
> recently committed" files only?
There are many ways to list and manipulate the files stored in the 
repository, as of any commit that you want.

> 3) If the answer to the above questions is "No", then what is the normal way
> for a programming shop which is using git to extract/assemble the list of
> approved files for building a release?

The first step, which git will help you with, is to ensure that you are 
working with the right version of the code and development files (the 
version you tested, that you intend to release).  From there, extracting 
and deploying the files necessary for a release is up to you.

  reply	other threads:[~2012-10-11 18:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10 18:03 A basic question Jim Vahl
2012-10-10 19:36 ` Drew Northup
2012-10-11 17:38   ` Jim Vahl
2012-10-11 18:40     ` James Nylen [this message]
     [not found]     ` <CA++fsGFruWFauX3XkynwcRLqK9H16frW86of3Y3ScgzGFmz=dg@mail.gmail.com>
2012-10-11 18:46       ` Dov Grobgeld
2012-10-12 15:56       ` A basic question - Thanks to all responders Jim Vahl
2012-10-11 18:51     ` A basic question Enrico Weigelt
2012-10-12  0:58     ` Sitaram Chamarty
2012-10-12  1:08     ` PJ Weisberg

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=507712AC.7090801@gmail.com \
    --to=jnylen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jv@wmdb.com \
    --cc=skotd122@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).