Skip to content

Conversation

heywens
Copy link

@heywens heywens commented Feb 24, 2018

Translation for submodules.asc - part 2
Word count not including commands displayed on console.
Kindly check this contribution.

Thanks.

The other listing in the `git status` output is the project folder entry.
If you run `git diff` on that, you see something interesting:
Ang ibang paglilista sa `git status` na output ay ang entry ng folder ng proyekto.
Kung papatakbuhin mo ang `git diff` doon, nakikita mo ang isang kawili-wiling bagay:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kawili-wiling to kawili-wili na


Although `DbConnector` is a subdirectory in your working directory, Git sees it as a submodule and doesn’t track its contents when you’re not in that directory.
Instead, Git sees it as a particular commit from that repository.
Kahit na ang `DbConnector` ay isang subdirectory ng iyong tinatrabahuang direktoryo, nakikita ito ng Git bilang isang submodule at hindi nagsusubaybay sa mga nilalaman nito kapag wala ka sa direktoryo iyon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdirectory to subdirektoryo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Notice the `160000` mode for the `DbConnector` entry.
That is a special mode in Git that basically means you’re recording a commit as a directory entry rather than a subdirectory or a file.
Pansinin ang mode na `160000` para sa entry ng `DbConnector`.
Iyon ay isang espesyal na mode sa Git na nangangahulugan na ikaw ay nagtatala ng isang commit bilang isang entry ng direktoryo sa halip na isang subdirectory o isang file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdirectory to subdirektoryo


[[_cloning_submodules]]
==== Cloning a Project with Submodules
==== Pagkokopya ng isang Proyekto na may mga Submodule

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submodule to Submodyul


Here we’ll clone a project with a submodule in it.
When you clone such a project, by default you get the directories that contain submodules, but none of the files within them yet:
Dito, ating ikokopya ang isang proyekto na may isang submodule sa loob nito.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Here we’ll clone a project with a submodule in it.
When you clone such a project, by default you get the directories that contain submodules, but none of the files within them yet:
Dito, ating ikokopya ang isang proyekto na may isang submodule sa loob nito.
Kapag ikaw ay nagkokopya tulad ng proyektong ito, bilang default, nakakakuha ka ng mga direktoryo na naglalaman ng mga submodule, ngunit wala pa sa mga file na ito ang nasa loob nito:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

----

Now your `DbConnector` subdirectory is at the exact state it was in when you committed earlier.
Ngayon na ang iyong subdirectory na `DbConnector` ay nasa eksaktong estado kung nasaan ito kumakailan noong na-commit mo kanina.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdirectory to subdirektoryo

There is another way to do this which is a little simpler, however.
If you pass `--recurse-submodules` to the `git clone` command, it will automatically initialize and update each submodule in the repository.
May ibang paraan upang gawin ito kung saan ay mas simple, gayunman.
Kung ipapasa mo ang `--recurse-submodules` sa uto na `git clone`, ito ay awtomating magsisimula at mag-update ng bawat submodule sa repositoryo.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awtomating to awtomatikong

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

----

==== Working on a Project with Submodules
==== Pagtatrabaho sa isang Proyekto na may mga Submodule

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submodule to Submodyul

==== Pagtatrabaho sa isang Proyekto na may mga Submodule

Now we have a copy of a project with submodules in it and will collaborate with our teammates on both the main project and the submodule project.
Ngayon na mayroon tayong isang kopya ng isang proyekto na may mga submodule sa loob nito at makikupagtulungan sa ating mga kasamahan sa koponan sa kapwa pangunahing proyekto at submodule na proyekto.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul


The simplest model of using submodules in a project would be if you were simply consuming a subproject and wanted to get updates from it from time to time but were not actually modifying anything in your checkout.
Let's walk through a simple example there.
Ang pinakasimpleng model ng paggamit ng mga submodule sa isang proyekto ay kung ikaw ay nag-uubos lamang ng isang subproject at nais na makakuha ng mga pagbabago mula dito sa pana-panahon ngunit hindi akwtal na nagbabago ng anuman sa iyong pagsusuri.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model to modelo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subproject to subproyekto

Talakayin natin ang isang simpleng halimbawa doon.

If you want to check for new work in a submodule, you can go into the directory and run `git fetch` and `git merge` the upstream branch to update the local code.
Kung gusto mong magsuri para sa bagong trabaho sa isang submodule, maaari kang pumunta sa direktoryo at patakbuhin ang `git fetch` at `git merge` ang upstream na branch upang ma-update ang lokal na code.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul


Now if you go back into the main project and run `git diff --submodule` you can see that the submodule was updated and get a list of commits that were added to it.
If you don't want to type `--submodule` every time you run `git diff`, you can set it as the default format by setting the `diff.submodule` config value to ``log''.
Kung gusto mo ngayong bumalik sa pangunahing proyekto at patakbuhin ang `git diff --submodule`, maaari mong makita na ang submodule ay na-update at makakuha ng isang listahan ng mga commit na naidagdag dito.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul


There is an easier way to do this as well, if you prefer to not manually fetch and merge in the subdirectory.
If you run `git submodule update --remote`, Git will go into your submodules and fetch and update for you.
Mayroong din isang mas madaling paraan upang gawin ito, kung naisin mo na hindi manu-manong kunin at i-merge sa subdirectory.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdirectory to subdirektoryo

There is an easier way to do this as well, if you prefer to not manually fetch and merge in the subdirectory.
If you run `git submodule update --remote`, Git will go into your submodules and fetch and update for you.
Mayroong din isang mas madaling paraan upang gawin ito, kung naisin mo na hindi manu-manong kunin at i-merge sa subdirectory.
Kung patakbuhin mo ang `git submodule update --remote`, pupuntahan ng Git ang iyong mga submodule at kunin at i-update para sa iyo.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

You can, however, set this to something different if you want.
For example, if you want to have the DbConnector submodule track that repository's ``stable'' branch, you can set it in either your `.gitmodules` file (so everyone else also tracks it), or just in your local `.git/config` file.
Let's set it in the `.gitmodules` file:
Ang utos na ito ay ipagpalagay bilang defualt na nais mong i-update ang paglabas sa branch ng `master` ng repositoryo ng submodule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Let's set it in the `.gitmodules` file:
Ang utos na ito ay ipagpalagay bilang defualt na nais mong i-update ang paglabas sa branch ng `master` ng repositoryo ng submodule.
Kaya mo, gayunpaman, itakda ito sa ibang bagay kung gusto mo.
Halimbawa, kung gusto mo na subaybayan ng DbConnector na submodule ang ``stable'' na branch ng repostiryong iyon, maaari mong itakda ito sa alinman sa iyong file na `.gitmodules` (upang subaybayan din ng iba), o sa iyong lokal na `.git/config` na file lamang.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repostiryong to repositoryong

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Kung iiwanan mo ang `-f .gitmodules`, ito ay gagawa lamang ng pagbabago para sa iyo, ngunit malamang na ito ay mas makatutulong upang masubaybayan ang impormasyong iyon sa repositoryo upang ang iba naman ay makagagawa rin.

When we run `git status` at this point, Git will show us that we have ``new commits'' on the submodule.
Kapag patakbuhin natin ang `git status` sa puntong ito, ipapakita ng Git sa atin na mayroon tayong ``bagong mga commit'' sa submodule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

----

If you set the configuration setting `status.submodulesummary`, Git will also show you a short summary of changes to your submodules:
Kung nagtatakda ka ang setting ng pagsasaayos na `status.submodulesummary`, ipapakita din ng Git sa iyo ang isang maikling buod ng mga pagbabago sa iyong mga submodule:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

nabago: DbConnector (mga bagong commit)
Submodules changed but not updated:
Mga submodule na nabago ngunit hindi na-update:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

----

At this point if you run `git diff` we can see both that we have modified our `.gitmodules` file and also that there are a number of commits that we've pulled down and are ready to commit to our submodule project.
Sa puntong ito kung patakbuhin mo ang `git diff` maaari nating parehong makita na binago natin ang ating` .gitmodules` na file at na mayroon ding isang bilang ng mga commit na ating na-pull pababa at handa na i-commit sa ating submodule na proyekto.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul


This is pretty cool as we can actually see the log of commits that we're about to commit to in our submodule.
Once committed, you can see this information after the fact as well when you run `git log -p`.
Ito ay medyo cool bilang maaari nating aktwal na makita ang log ng mga commit na ating iko-commit sa ating submodule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool to astig

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

----

Git will by default try to update *all* of your submodules when you run `git submodule update --remote` so if you have a lot of them, you may want to pass the name of just the submodule you want to try to update.
Bilang default, susubukan ng Git na i-update ang *lahat* ng iyong mga submodule kapag nagpatakbo ka ng `git submodule update --remote` kaya kung mayroon kang maraming mga ito, maaari mong gustuhin na ipasa ang pangalan ng submodule lamang na gusto mong subukang i-update.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Bilang default, susubukan ng Git na i-update ang *lahat* ng iyong mga submodule kapag nagpatakbo ka ng `git submodule update --remote` kaya kung mayroon kang maraming mga ito, maaari mong gustuhin na ipasa ang pangalan ng submodule lamang na gusto mong subukang i-update.

===== Working on a Submodule
===== Pagtatrabaho sa isang Submodule

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submodule to Submodyul

Kung hindi man ay malamang na ikaw ay gumamit ng isang mas simple na sistema ng pamamahala ng dependensya (tulad ng Maven o Rubygems).

So now let's go through an example of making changes to the submodule at the same time as the main project and committing and publishing those changes at the same time.
Kaya ngayon ay talakayin natin ang isang halimbawa ng paggawa ng mga pagbabago sa submodule sa parehong oras sa pangunahing proyekto at pag-commit at paglalathala sa mga pagbabago iyon sa parehong oras.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul


It's quite likely that if you're using submodules, you're doing so because you really want to work on the code in the submodule at the same time as you're working on the code in the main project (or across several submodules).
Otherwise you would probably instead be using a simpler dependency management system (such as Maven or Rubygems).
Malamang na kung gumagamit ka ng mga submodule, ginagawa mo ito dahil gusto mo talagang magtrabaho sa code sa submodule sa parehong oras habang nagtatrabaho ka sa code sa pangunahing proyekto (o sa ilang mga submodule).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

This means that there is no local working branch (like ``master'', for example) tracking changes.
With no working branch tracking changes, that means even if you commit changes to the submodule, those changes will quite possibly be lost the next time you run `git submodule update`.
You have to do some extra steps if you want changes in a submodule to be tracked.
Sa ngayon, kapag pinatakbo natin ang utos na `git submodule update` upang makuha ang mga pagbabago mula sa mga repositoryo ng submodule, makakakuha ang Git ng mga pagbabago at i-update ang mga file sa subdirectory ngunit iiwan ang sub-repository sa tinatawag na `estado na `nakahiwalay na HEAD''.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdirectory to subdirektoryo

You have to do some extra steps if you want changes in a submodule to be tracked.
Sa ngayon, kapag pinatakbo natin ang utos na `git submodule update` upang makuha ang mga pagbabago mula sa mga repositoryo ng submodule, makakakuha ang Git ng mga pagbabago at i-update ang mga file sa subdirectory ngunit iiwan ang sub-repository sa tinatawag na `estado na `nakahiwalay na HEAD''.
Ito ay nangangahulugan na walang lokal na tinatrabahuang branch (tulad ng ``master'', halimbawa) na nagsusubaybay ng mga pagbabago.
Ng walang tinatrabahuang branch na nagsusubaybay ng mga pagbabago, iyon ay nangangahulugan na kahit na ikaw ay mag-commit ng mga pagbabago sa submodule, ang mga pagbabagong iyon ay posibleng mawala sa susunod na patakbuhin mo ang `git submodule update`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

Sa ngayon, kapag pinatakbo natin ang utos na `git submodule update` upang makuha ang mga pagbabago mula sa mga repositoryo ng submodule, makakakuha ang Git ng mga pagbabago at i-update ang mga file sa subdirectory ngunit iiwan ang sub-repository sa tinatawag na `estado na `nakahiwalay na HEAD''.
Ito ay nangangahulugan na walang lokal na tinatrabahuang branch (tulad ng ``master'', halimbawa) na nagsusubaybay ng mga pagbabago.
Ng walang tinatrabahuang branch na nagsusubaybay ng mga pagbabago, iyon ay nangangahulugan na kahit na ikaw ay mag-commit ng mga pagbabago sa submodule, ang mga pagbabagong iyon ay posibleng mawala sa susunod na patakbuhin mo ang `git submodule update`.
Kailangan mong gawin ang ilang mga dagdag na hakbang kung nais mong baguhin ang mga submodule na susubaybayan.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule to submodyul

@mind-blast
Copy link

Please find time to check my suggested words.

@heywens
Copy link
Author

heywens commented Feb 25, 2018

Hi Sir @Robin-Ho, thanks for the review. Some suggestions were applied except for the following words:

  • submodule
  • subdirectory

@severinolorillajr severinolorillajr merged commit 31b5aed into progit2-tl:master Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants